From de2f0e964101dbb3578fc6c400e6df442c94b392 Mon Sep 17 00:00:00 2001 From: Kevin Ushey Date: Tue, 20 Oct 2026 12:48:08 -0700 Subject: [PATCH] keep the insert symbol popup open across decoration-only transactions The realtime spelling plugin dispatches an updateSpelling transaction 100ms and 5s after the editor is first focused, whether or not realtime spelling is enabled. InsertSymbolPlugin closed its popup on every plugin view update, so an Insert Emoji / Insert Unicode popup still open at the 5s mark vanished mid-typing. Only close the popup when the document or selection changed. (cherry picked from commit bef48d7baee4452033c2e347d798dfeea2b75c4e) --- .../behaviors/insert_symbol/insert_symbol-plugin.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/editor/src/behaviors/insert_symbol/insert_symbol-plugin.tsx b/packages/editor/src/behaviors/insert_symbol/insert_symbol-plugin.tsx index d625b56c8..68e3ba142 100644 --- a/packages/editor/src/behaviors/insert_symbol/insert_symbol-plugin.tsx +++ b/packages/editor/src/behaviors/insert_symbol/insert_symbol-plugin.tsx @@ -48,8 +48,14 @@ export class InsertSymbolPlugin extends Plugin { super({ key: pluginKey, view: () => ({ - update: () => { - this.closePopup(); + update: (view: EditorView, prevState: EditorState) => { + // The realtime spelling plugin dispatches decoration-only + // transactions on a timer (100ms and 5s after the editor is first + // focused), so only treat a change to the document or selection as + // a reason to dismiss the popup. + if (!view.state.doc.eq(prevState.doc) || !view.state.selection.eq(prevState.selection)) { + this.closePopup(); + } }, destroy: () => { this.closePopup();