From 1d99c4e80b36feda4b2150276889e02f5b3ef5c1 Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 21 Apr 2021 22:03:41 +0200 Subject: [PATCH] fix moving notes with keyboard on Firefox, closes #1865 --- src/public/app/widgets/note_tree.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index 4bff5f701..baf16e31f 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -1144,11 +1144,12 @@ export default class NoteTreeWidget extends TabAwareWidget { } if (node) { - node.setActive(true, {noEvents: true, noFocus: !activeNodeFocused}); - if (activeNodeFocused) { - node.setFocus(true); + // needed by Firefox: https://github.com/zadam/trilium/issues/1865 + this.tree.$container.focus(); } + + await node.setActive(true, {noEvents: true, noFocus: !activeNodeFocused}); } else { // this is used when original note has been deleted and we want to move the focus to the note above/below