From 4c93334d90852f395e1503092d48193ef8a2a8a3 Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 30 Jul 2022 23:43:20 +0200 Subject: [PATCH] fix focusing ribbon tabs when using keyboard navigation on the tree --- src/public/app/widgets/containers/ribbon_container.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/public/app/widgets/containers/ribbon_container.js b/src/public/app/widgets/containers/ribbon_container.js index 6cd4db53e..0d821f672 100644 --- a/src/public/app/widgets/containers/ribbon_container.js +++ b/src/public/app/widgets/containers/ribbon_container.js @@ -188,10 +188,12 @@ export default class RibbonContainer extends NoteContextAwareWidget { if (activeChild && (refreshActiveTab || !wasAlreadyActive)) { const handleEventPromise = activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath}); - if (handleEventPromise) { - handleEventPromise.then(() => activeChild.focus?.()); - } else { - activeChild.focus?.(); + if (refreshActiveTab) { + if (handleEventPromise) { + handleEventPromise.then(() => activeChild.focus?.()); + } else { + activeChild.focus?.(); + } } } } else {