refactoring
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -3,3 +3,4 @@ export { Commands } from './commands'
|
||||
export { Editable } from './editable'
|
||||
export { FocusEvents } from './focusEvents'
|
||||
export { Keymap } from './keymap'
|
||||
export { Tabindex } from './tabindex'
|
||||
|
||||
19
packages/core/src/extensions/tabindex.ts
Normal file
19
packages/core/src/extensions/tabindex.ts
Normal 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',
|
||||
},
|
||||
},
|
||||
}),
|
||||
]
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user