Skip to content

Build your personal knowledge base with Trilium Notes

fix(popup_editor): block toolbar from behind modal interfering

Elian Doran8dca79ecf279
diff --git a/apps/client/src/widgets/dialogs/popup_editor.ts b/apps/client/src/widgets/dialogs/popup_editor.ts
index 76938aba83..30ffaee432 100644
--- a/apps/client/src/widgets/dialogs/popup_editor.ts
+++ b/apps/client/src/widgets/dialogs/popup_editor.ts
@@ -108,6 +108,11 @@ export default class PopupEditorDialog extends Container<BasicWidget> {
await this.noteContext.setNote(noteIdOrPath);
+ const activeEl = document.activeElement;
+ if (activeEl && "blur" in activeEl) {
+ (activeEl as HTMLElement).blur();
+ }
+
$dialog.on("shown.bs.modal", async () => {
// Reduce the z-index of modals so that ckeditor popups are properly shown on top of it.
// The backdrop instance is not shared so it's OK to make a one-off modification.