This commit is contained in:
2026-01-15 02:13:52 +01:00
parent 25ebaa847b
commit e0ec98fcb8
3 changed files with 41 additions and 25 deletions

View File

@@ -325,6 +325,7 @@
if (editor.__bridgeRteModalOpen) return;
editor.__bridgeRteModalOpen = true;
editor.__bridgeRteAllowClose = false;
let reopenGuard = false;
if (!modal.__bridgeCloseLocked) {
modal.__bridgeCloseLocked = true;
@@ -550,6 +551,21 @@
editor.__bridgeRteAllowClose = false;
});
}
const mdl = modal.getModel && modal.getModel();
if (mdl && typeof mdl.on === 'function') {
const handler = () => {
if (editor.__bridgeRteAllowClose) {
mdl.off && mdl.off('change:open', handler);
return;
}
if (!mdl.get('open') && !reopenGuard) {
reopenGuard = true;
mdl.set('open', true);
setTimeout(() => { reopenGuard = false; }, 0);
}
};
mdl.on('change:open', handler);
}
try {
modal.open({ closeOnEsc: false, closeOnClick: false });
} catch {