Skip to content

Build your personal knowledge base with Trilium Notes

fix ribbon tab not appearing

zadam7400a6723e29
diff --git a/src/public/app/widgets/containers/ribbon_container.js b/src/public/app/widgets/containers/ribbon_container.js
index a814957a4f..5502878070 100644
--- a/src/public/app/widgets/containers/ribbon_container.js
+++ b/src/public/app/widgets/containers/ribbon_container.js
@@ -176,6 +176,8 @@ export default class RibbonContainer extends NoteContextAwareWidget {
if (activate) {
const ribbonComponendId = $ribbonTitle.attr('data-ribbon-component-id');
+ const wasAlreadyActive = this.lastActiveComponentId === ribbonComponendId;
+
this.lastActiveComponentId = ribbonComponendId;
this.$tabContainer.find(`.ribbon-tab-title[data-ribbon-component-id="${ribbonComponendId}"]`).addClass("active");
@@ -183,7 +185,7 @@ export default class RibbonContainer extends NoteContextAwareWidget {
const activeChild = this.getActiveRibbonWidget();
- if (activeChild && refreshActiveTab) {
+ if (activeChild && (refreshActiveTab || !wasAlreadyActive)) {
activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath});
}
} else {