From 0a330ed79b9341135c955d152134c27957c19714 Mon Sep 17 00:00:00 2001 From: Henrique Buzon Date: Wed, 11 Feb 2026 01:58:55 -0300 Subject: [PATCH 1/2] fix: preserve text selection highlight on right-click --- .../src/core/presentation-editor/PresentationEditor.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/super-editor/src/core/presentation-editor/PresentationEditor.ts b/packages/super-editor/src/core/presentation-editor/PresentationEditor.ts index f7134fcc69..85d114eb79 100644 --- a/packages/super-editor/src/core/presentation-editor/PresentationEditor.ts +++ b/packages/super-editor/src/core/presentation-editor/PresentationEditor.ts @@ -1,4 +1,5 @@ import { NodeSelection, Selection, TextSelection } from 'prosemirror-state'; +import { SlashMenuPluginKey } from '@extensions/slash-menu/slash-menu.js'; import { CellSelection } from 'prosemirror-tables'; import type { EditorState, Transaction } from 'prosemirror-state'; import type { Node as ProseMirrorNode, Mark } from 'prosemirror-model'; @@ -3367,8 +3368,10 @@ export class PresentationEditor extends EventEmitter { const activeEditor = this.getActiveEditor(); const hasFocus = activeEditor?.view?.hasFocus?.() ?? false; + // Keep selection visible when context menu (SlashMenu) is open + const slashMenuOpen = !!SlashMenuPluginKey.getState(activeEditor?.state)?.open; - if (!hasFocus) { + if (!hasFocus && !slashMenuOpen) { try { this.#clearSelectedFieldAnnotationClass(); this.#localSelectionLayer.innerHTML = ''; From b0c7f65fe88a3577e546b84478c2d3830eee525d Mon Sep 17 00:00:00 2001 From: Henrique Macedo <47286998+henriquedevelops@users.noreply.github.com> Date: Wed, 11 Feb 2026 15:24:24 -0300 Subject: [PATCH 2/2] Update packages/super-editor/src/core/presentation-editor/PresentationEditor.ts Co-authored-by: Caio Pizzol <97641911+caio-pizzol@users.noreply.github.com> --- .../src/core/presentation-editor/PresentationEditor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/super-editor/src/core/presentation-editor/PresentationEditor.ts b/packages/super-editor/src/core/presentation-editor/PresentationEditor.ts index 85d114eb79..015ef89d25 100644 --- a/packages/super-editor/src/core/presentation-editor/PresentationEditor.ts +++ b/packages/super-editor/src/core/presentation-editor/PresentationEditor.ts @@ -3369,7 +3369,7 @@ export class PresentationEditor extends EventEmitter { const activeEditor = this.getActiveEditor(); const hasFocus = activeEditor?.view?.hasFocus?.() ?? false; // Keep selection visible when context menu (SlashMenu) is open - const slashMenuOpen = !!SlashMenuPluginKey.getState(activeEditor?.state)?.open; + const slashMenuOpen = activeEditor?.state ? !!SlashMenuPluginKey.getState(activeEditor.state)?.open : false; if (!hasFocus && !slashMenuOpen) { try {