From 24913d1a64f531300ed187adba080646fdaf07c9 Mon Sep 17 00:00:00 2001 From: Abdo Date: Sun, 29 Jun 2025 05:26:37 +0300 Subject: [PATCH] Fix context menu input field focus handling --- ts/routes/editor/NoteEditor.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts/routes/editor/NoteEditor.svelte b/ts/routes/editor/NoteEditor.svelte index 43096e18d..b0bd2bc3a 100644 --- a/ts/routes/editor/NoteEditor.svelte +++ b/ts/routes/editor/NoteEditor.svelte @@ -89,6 +89,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html let contextMenu: ContextMenu; const [onContextMenu, contextMenuItems] = setupContextMenu(); + let contextMenuInput: EditingInputAPI | null = null; + function quoteFontFamily(fontFamily: string): string { // generic families (e.g. sans-serif) must not be quoted @@ -1008,6 +1010,7 @@ components and functionality for general note editing. role="presentation" bind:this={noteEditor} on:contextmenu={(event) => { + contextMenuInput = $focusedInput; onContextMenu(event, api, $focusedInput, contextMenu); }} on:dragover|preventDefault @@ -1196,7 +1199,7 @@ components and functionality for general note editing. { item.action(); - $focusedInput?.focus(); + contextMenuInput?.focus(); }} > {item.label}