@sequent-org/moodboard 1.4.24 → 1.4.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequent-org/moodboard",
3
- "version": "1.4.24",
3
+ "version": "1.4.25",
4
4
  "type": "module",
5
5
  "description": "Interactive moodboard",
6
6
  "main": "./src/index.js",
@@ -221,6 +221,9 @@ export function bindTextEditorInteractions(controller, {
221
221
  export function closeTextEditorFromState(controller, commit) {
222
222
  const textarea = controller.textEditor.textarea;
223
223
  if (!textarea) return;
224
+ const wrapper = controller.textEditor.wrapper || null;
225
+ const removeDomListeners = controller.textEditor._removeDomListeners || null;
226
+ const placeholderStyleEl = controller.textEditor._phStyle || null;
224
227
  const value = textarea.value.trim();
225
228
  const commitValue = commit && value.length > 0;
226
229
  const objectType = controller.textEditor.objectType || 'text';
@@ -252,7 +255,17 @@ export function closeTextEditorFromState(controller, commit) {
252
255
  }
253
256
  }
254
257
 
255
- textarea.remove();
258
+ if (typeof removeDomListeners === 'function') {
259
+ try { removeDomListeners(); } catch (_) {}
260
+ }
261
+ if (placeholderStyleEl && typeof placeholderStyleEl.remove === 'function') {
262
+ try { placeholderStyleEl.remove(); } catch (_) {}
263
+ }
264
+ if (wrapper && typeof wrapper.remove === 'function') {
265
+ wrapper.remove();
266
+ } else {
267
+ textarea.remove();
268
+ }
256
269
  controller.textEditor = { active: false, objectId: null, textarea: null, world: null, objectType: 'text' };
257
270
  if (!commitValue) {
258
271
  if (shouldDeleteEmptyNewCreation) {