ohne blur

This commit is contained in:
2026-02-05 00:22:50 +01:00
parent 72b799d546
commit ca3f40dd88
2 changed files with 7 additions and 7 deletions

View File

@@ -1 +1 @@
1.2.49 1.2.50

View File

@@ -509,12 +509,12 @@
return false; return false;
}; };
// 1) Bevorzugt: ausgewähltes Component-Element aus der View // 1) Wenn ein ContentEditable aktiv ist, Blur auslösen, damit GrapesJS den Model-Content übernimmt
if (selected) { if (active && (active.isContentEditable || (active.getAttribute && active.getAttribute('contenteditable') === 'true'))) {
const selEl = (selected.getEl && selected.getEl()) || (selected.view && selected.view.el); try {
if (selEl && (selEl.isContentEditable || (selEl.getAttribute && selEl.getAttribute('contenteditable') === 'true'))) { active.dispatchEvent(new Event('blur', { bubbles: true }));
syncFromElement(selected, selEl, 'selected:view'); syncReason = 'blur:dispatched';
} } catch {}
} }
// 2) Fallback: Selection im DOM suchen // 2) Fallback: Selection im DOM suchen