Skip to content

Build your personal knowledge base with Trilium Notes

fix(client): tree operations no longer working due to loss of focus

Elian Dorandf3b9faf8d34
diff --git a/apps/client/src/widgets/type_widgets/type_widget.ts b/apps/client/src/widgets/type_widgets/type_widget.ts
index 9cd8a64abd..31ecbf6174 100644
--- a/apps/client/src/widgets/type_widgets/type_widget.ts
+++ b/apps/client/src/widgets/type_widgets/type_widget.ts
@@ -76,8 +76,10 @@ export default abstract class TypeWidget extends NoteContextAwareWidget {
return;
}
- // Restore focus to the editor when switching tabs.
- this.focus();
+ // Restore focus to the editor when switching tabs, but only if the note tree is not already focused.
+ if (!document.activeElement?.classList.contains("fancytree-title")) {
+ this.focus();
+ }
}
/**