Skip to content
Snippets Groups Projects

fix: focus editor before inserting

Merged Dennis Collaris requested to merge fix/focus-editor-before-inserting into main
1 file
+ 3
0
Compare changes
  • Side-by-side
  • Inline
@@ -12,6 +12,9 @@ export const InsertVariablesPlugin = () => {
const onChange = (value: string | number, type: VariableType) => {
editor.update(() => {
const editorElement = document.querySelector('.editor > div') as HTMLDivElement;
editorElement?.focus();
const selection = $getSelection() as BaseSelection;
const node = new VariableNode(String(value), type);
Loading