Skip to content

Build your personal knowledge base with Trilium Notes

fix(tab): editor not focused after switching tabs

Elian Doran0f1c5058234b
diff --git a/apps/client/src/widgets/type_widgets/type_widget.ts b/apps/client/src/widgets/type_widgets/type_widget.ts
index 3a437e1092..9cd8a64abd 100644
--- a/apps/client/src/widgets/type_widgets/type_widget.ts
+++ b/apps/client/src/widgets/type_widgets/type_widget.ts
@@ -71,6 +71,15 @@ export default abstract class TypeWidget extends NoteContextAwareWidget {
}
}
+ activeNoteChangedEvent() {
+ if (!this.isActiveNoteContext()) {
+ return;
+ }
+
+ // Restore focus to the editor when switching tabs.
+ this.focus();
+ }
+
/**
* {@inheritdoc}
*