@sequent-org/moodboard 1.4.21 → 1.4.22

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.21",
3
+ "version": "1.4.22",
4
4
  "type": "module",
5
5
  "description": "Interactive moodboard",
6
6
  "main": "./src/index.js",
@@ -120,7 +120,11 @@ export function createTextEditorFinalize(controller, {
120
120
  updateGlobalTextEditorHandlesLayer();
121
121
 
122
122
  if (!commitValue) {
123
- if (isNewCreation && objectId) {
123
+ // Safety against race conditions: when a newly-created editor is blurred by
124
+ // tool-switch/outside click, do not auto-delete the object. Explicit cancel
125
+ // (Esc -> commit === false) still removes empty creation.
126
+ const shouldDeleteEmptyNewCreation = isNewCreation && objectId && commit === false;
127
+ if (shouldDeleteEmptyNewCreation) {
124
128
  controller.eventBus.emit(Events.Tool.ObjectsDelete, { objects: [objectId] });
125
129
  }
126
130
  return;