Skip to content

Build your personal knowledge base with Trilium Notes

fix focusing ribbon tabs when using keyboard navigation on the tree

zadam4c93334d9085
diff --git a/src/public/app/widgets/containers/ribbon_container.js b/src/public/app/widgets/containers/ribbon_container.js
index 6cd4db53e6..0d821f6728 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 {