UNPKG

@tiptap/core

Version:

headless rich text editor

19 lines (15 loc) 423 B
import { Plugin, PluginKey } from '@tiptap/pm/state' import { Extension } from '../Extension.js' export const Tabindex = Extension.create({ name: 'tabindex', addProseMirrorPlugins() { return [ new Plugin({ key: new PluginKey('tabindex'), props: { attributes: (): { [name: string]: string; } => (this.editor.isEditable ? { tabindex: '0' } : {}), }, }), ] }, })