Keyboard navigation improvements across all editors
TiptapEditor.vue (central — applies to all three editors): - Escape inside editor blurs it and emits 'escape' event to parent TagInput.vue (central — applies everywhere tags are used): - ArrowUp/ArrowDown navigate autocomplete suggestion list with visual highlight - Enter confirms the keyboard-selected suggestion instead of typed text NoteEditorView, TaskEditorView, WorkspaceNoteEditor (per-editor wiring): - @escape on TiptapEditor returns focus to the title input (ref="titleRef") - Ctrl+E from title input or editor main column jumps focus into editor body - Ctrl+S on title input saves (was already on editor area; now consistent) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,7 @@ const props = withDefaults(
|
||||
const emit = defineEmits<{
|
||||
"update:modelValue": [value: string];
|
||||
selectionChange: [payload: { text: string; start: number; end: number }];
|
||||
escape: [];
|
||||
}>();
|
||||
|
||||
let updatingFromProp = false;
|
||||
@@ -41,6 +42,14 @@ try {
|
||||
content: markdownToHtml(props.modelValue),
|
||||
editable: true,
|
||||
editorProps: {
|
||||
handleKeyDown: (_view, event) => {
|
||||
if (event.key === "Escape") {
|
||||
editor?.commands.blur();
|
||||
emit("escape");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
handlePaste: (_view, event) => {
|
||||
const text = event.clipboardData?.getData("text/plain");
|
||||
if (!text || !editor) return false;
|
||||
|
||||
Reference in New Issue
Block a user