diff --git a/apps/client/src/widgets/dialogs/PopupEditor.tsx b/apps/client/src/widgets/dialogs/PopupEditor.tsx
index b19851bb9..070244b56 100644
--- a/apps/client/src/widgets/dialogs/PopupEditor.tsx
+++ b/apps/client/src/widgets/dialogs/PopupEditor.tsx
@@ -12,6 +12,7 @@ const noteContext = new NoteContext("_popup-editor");
export default function PopupEditor() {
const [ shown, setShown ] = useState(false);
+ const parentComponent = useContext(ParentComponent);
useTriliumEvent("openInPopup", async ({ noteIdOrPath }) => {
await noteContext.setNote(noteIdOrPath, {
@@ -30,6 +31,9 @@ export default function PopupEditor() {
className="popup-editor-dialog"
size="lg"
show={shown}
+ onShown={() => {
+ parentComponent?.handleEvent("focusOnDetail", { ntxId: noteContext.ntxId });
+ }}
onHidden={() => setShown(false)}
>
diff --git a/apps/client/src/widgets/dialogs/popup_editor.ts b/apps/client/src/widgets/dialogs/popup_editor.ts
index 9899ad163..1cadb3ab6 100644
--- a/apps/client/src/widgets/dialogs/popup_editor.ts
+++ b/apps/client/src/widgets/dialogs/popup_editor.ts
@@ -58,7 +58,6 @@ export default class PopupEditorDialog extends Container {
$dialog.on("shown.bs.modal", async () => {
this.setVisibility(true);
- await this.handleEventInChildren("focusOnDetail", { ntxId: this.noteContext.ntxId });
});
$dialog.on("hidden.bs.modal", () => {
const $typeWidgetEl = $dialog.find(".note-detail-printable");
diff --git a/apps/client/src/widgets/type_widgets/text/CKEditorWithWatchdog.tsx b/apps/client/src/widgets/type_widgets/text/CKEditorWithWatchdog.tsx
index 789e0d006..e19032d46 100644
--- a/apps/client/src/widgets/type_widgets/text/CKEditorWithWatchdog.tsx
+++ b/apps/client/src/widgets/type_widgets/text/CKEditorWithWatchdog.tsx
@@ -41,7 +41,6 @@ export default function CKEditorWithWatchdog({ containerRef: externalContainerRe
const [ editor, setEditor ] = useState();
const { parentComponent, ntxId } = useNoteContext();
- console.log("Register with ntxId", ntxId);
useKeyboardShortcuts("text-detail", containerRef, parentComponent, ntxId);
useImperativeHandle(editorApi, () => ({