hensei-web/extensions/NoNewLine/index.tsx
Justin Edmund a4e4328329
Add support for including/excluding items from team filtering (#363)
This PR adds support for including/excluding specific items from team
filtering. Users can use the filter modal to only show teams that
include specific items, only show teams that _don't_ include specific
items, or combine the two to create a very powerful filter.
2023-08-21 20:01:11 -07:00

26 lines
664 B
TypeScript

import { Extension } from '@tiptap/core'
import { Plugin, PluginKey } from 'prosemirror-state'
const NoNewLine = Extension.create({
name: 'no_new_line',
addProseMirrorPlugins() {
return [
new Plugin({
key: new PluginKey('eventHandler'),
props: {
handleKeyDown: (view, event) => {
if (event.key === 'Enter' && !event.shiftKey) {
console.log('enter pressed')
return true
}
},
// … and many, many more.
// Here is the full list: https://prosemirror.net/docs/ref/#view.EditorProps
},
}),
]
},
})
export default NoNewLine