Skip to content

Commit f8bc773

Browse files
akolsonclaude
andcommitted
fix(rte): guard editor.value in nextTick with optional chaining
The synchronous null check doesn't protect against the component unmounting between the watcher firing and the nextTick callback running — useEditor's onUnmounted sets editor.value to null, which would cause a throw. Optional chaining handles this safely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7c45abf commit f8bc773

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor

contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/TipTapEditor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
}
208208
if (newMode === 'edit' && editor.value && props.autofocus) {
209209
nextTick(() => {
210-
editor.value.commands.focus('end');
210+
editor.value?.commands.focus('end');
211211
});
212212
}
213213
},

0 commit comments

Comments
 (0)