diff --git a/lib/components/tiptap/autofieldSelector/ext_autofill.ts b/lib/components/tiptap/autofieldSelector/ext_autofill.ts index 5f9935c..8812153 100644 --- a/lib/components/tiptap/autofieldSelector/ext_autofill.ts +++ b/lib/components/tiptap/autofieldSelector/ext_autofill.ts @@ -31,6 +31,7 @@ export interface AutofillExtensionOptions { export const AutofillExtension = Node.create({ name: 'autofillField', + priority: 150, group: 'inline', inline: true, atom: true, @@ -103,27 +104,27 @@ export const AutofillExtension = Node.create({ this.options.CustomDropdown, ) - return [ - Suggestion({ - editor: this.editor, - pluginKey: autofillSuggestionKey, - char: suggestion.char, - items: suggestion.items, + const suggestionPlugin = Suggestion({ + editor: this.editor, + pluginKey: autofillSuggestionKey, + char: suggestion.char, + items: suggestion.items, + + command: ({ editor, range, props }) => { + editor + .chain() + .focus() + .deleteRange(range) + .insertContent([ + { type: this.name, attrs: { value: props.value } }, + { type: 'text', text: ' ' }, + ]) + .run() + }, - command: ({ editor, range, props }) => { - editor - .chain() - .focus() - .deleteRange(range) - .insertContent([ - { type: this.name, attrs: { value: props.value } }, - { type: 'text', text: ' ' }, - ]) - .run() - }, + render: suggestion.render, + }) - render: suggestion.render, - }), - ] + return [suggestionPlugin] }, }) diff --git a/package.json b/package.json index 4ec5ba1..7921e6d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tapwrite", "private": false, - "version": "1.1.97", + "version": "1.1.98", "type": "module", "main": "dist/main.js", "types": "dist/main.d.ts",