diff --git a/src/public/javascripts/services/note_detail.js b/src/public/javascripts/services/note_detail.js index ad6a11a5e..6cae0511f 100644 --- a/src/public/javascripts/services/note_detail.js +++ b/src/public/javascripts/services/note_detail.js @@ -513,10 +513,8 @@ async function loadNote(noteId) { return new NoteFull(treeCache, row); } -function focus() { - const note = getCurrentNote(); - - getComponent(note.type).focus(); +function focusOnTitle() { + $noteTitle.focus(); } messagingService.subscribeToSyncMessages(syncData => { @@ -554,7 +552,7 @@ export default { getCurrentNoteType, getCurrentNoteId, newNoteCreated, - focus, + focusOnTitle, getAttributes, showAttributes, refreshAttributes, diff --git a/src/public/javascripts/services/tree_keybindings.js b/src/public/javascripts/services/tree_keybindings.js index df70bca91..7219994d8 100644 --- a/src/public/javascripts/services/tree_keybindings.js +++ b/src/public/javascripts/services/tree_keybindings.js @@ -100,7 +100,7 @@ const keyBindings = { return false; }, "return": node => { - noteDetailService.focus(); + noteDetailService.focusOnTitle(); return false; },