From 6fdec5233264effba090df43ac78eda9dbfd6d73 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 10 Jul 2025 22:48:33 +0300 Subject: [PATCH] fix(popup_editor): mind map not rendering properly --- apps/client/src/widgets/dialogs/popup_editor.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/client/src/widgets/dialogs/popup_editor.ts b/apps/client/src/widgets/dialogs/popup_editor.ts index be1ca9243..60d0f19d9 100644 --- a/apps/client/src/widgets/dialogs/popup_editor.ts +++ b/apps/client/src/widgets/dialogs/popup_editor.ts @@ -1,4 +1,5 @@ import type { EventNames, EventData } from "../../components/app_context.js"; +import appContext from "../../components/app_context.js"; import NoteContext from "../../components/note_context.js"; import { openDialog } from "../../services/dialog.js"; import BasicWidget from "../basic_widget.js"; @@ -99,11 +100,19 @@ export default class PopupEditorDialog extends Container { const $dialog = await openDialog(this.$widget, false, { focus: false }); + $dialog.on("shown.bs.modal", () => { // 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. $("body > .modal-backdrop").css("z-index", "998"); $dialog.css("z-index", "999"); + + // Mind map doesn't render off screen properly, so it needs refreshing once the modal is shown. + const $mindmap = $dialog.find(".note-detail-mind-map"); + if ($mindmap.length) { + const mindmapComponent = appContext.getComponentByEl($mindmap[0]); + mindmapComponent.refresh(); + } }); } }