diff --git a/apps/client/src/widgets/dialogs/popup_editor.ts b/apps/client/src/widgets/dialogs/popup_editor.ts index 76938aba8..30ffaee43 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 { 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.