refactoring

This commit is contained in:
Philipp Kühn
2021-09-22 22:45:27 +02:00
parent f4e3b07672
commit e5c765c8e4
9 changed files with 30 additions and 22 deletions

View File

@@ -11,9 +11,6 @@ export const FocusEvents = Extension.create({
new Plugin({
key: new PluginKey('focusEvents'),
props: {
attributes: {
tabindex: '0',
},
handleDOMEvents: {
focus: (view, event) => {
editor.isFocused = true

View File

@@ -3,3 +3,4 @@ export { Commands } from './commands'
export { Editable } from './editable'
export { FocusEvents } from './focusEvents'
export { Keymap } from './keymap'
export { Tabindex } from './tabindex'

View File

@@ -0,0 +1,19 @@
import { Plugin, PluginKey } from 'prosemirror-state'
import { Extension } from '../Extension'
export const Tabindex = Extension.create({
name: 'tabindex',
addProseMirrorPlugins() {
return [
new Plugin({
key: new PluginKey('tabindex'),
props: {
attributes: {
tabindex: '0',
},
},
}),
]
},
})