fix(jump_to_note): caret at the end when entering command mode (closes #7942)

This commit is contained in:
Elian Doran
2026-04-10 21:17:38 +03:00
parent 19583cd84a
commit 878603c7b0

View File

@@ -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", () => {