From 878603c7b00b7bc22ff2e8ba255607aa043a16b8 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 10 Apr 2026 21:17:38 +0300 Subject: [PATCH] fix(jump_to_note): caret at the end when entering command mode (closes #7942) --- apps/client/src/widgets/dialogs/jump_to_note.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/client/src/widgets/dialogs/jump_to_note.tsx b/apps/client/src/widgets/dialogs/jump_to_note.tsx index 89c4388039..44c825e082 100644 --- a/apps/client/src/widgets/dialogs/jump_to_note.tsx +++ b/apps/client/src/widgets/dialogs/jump_to_note.tsx @@ -80,9 +80,19 @@ export default function JumpToNoteDialogComponent() { break; } - $autoComplete - .trigger("focus") - .trigger("select"); + $autoComplete.trigger("focus"); + + if (mode === "commands") { + // In command mode, place caret at end instead of selecting all text + // This preserves the ">" prefix when the user starts typing + const input = autocompleteRef.current; + if (input) { + const len = input.value.length; + input.setSelectionRange(len, len); + } + } else { + $autoComplete.trigger("select"); + } // Add keyboard shortcut for full search shortcutService.bindElShortcut($autoComplete, "ctrl+return", () => {