virtual-tree-canvas 0.3.3 → 0.3.4
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
|
@@ -101,7 +101,10 @@ export class CellEditorManager {
|
|
|
101
101
|
padding: data.editorType === 'color' ? '0 2px' : data.editorType === 'select' ? '0 22px 0 8px' : '0 8px',
|
|
102
102
|
textAlign: data.editorType === 'number' || data.editorType === 'range' ? 'right' : 'left',
|
|
103
103
|
});
|
|
104
|
+
let committed = false;
|
|
104
105
|
const commit = () => {
|
|
106
|
+
if (committed) return;
|
|
107
|
+
committed = true;
|
|
105
108
|
const nextValue = parseEditorValue(element, data);
|
|
106
109
|
this.controller.updateInspectorValue(node.id, nextValue, data.editorType);
|
|
107
110
|
this.#removeOverlay();
|
|
@@ -110,6 +113,9 @@ export class CellEditorManager {
|
|
|
110
113
|
if (event.key === 'Enter') commit();
|
|
111
114
|
else if (event.key === 'Escape') this.#removeOverlay();
|
|
112
115
|
});
|
|
116
|
+
if (data.editorType === 'select') {
|
|
117
|
+
element.addEventListener('change', commit);
|
|
118
|
+
}
|
|
113
119
|
element.addEventListener('blur', commit);
|
|
114
120
|
ensureOverlayHost(this.host);
|
|
115
121
|
this.host.append(element);
|