@elementor/editor-controls 4.1.0-792 → 4.1.0-manual

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/dist/index.js CHANGED
@@ -1279,7 +1279,7 @@ var SizeControl = createControl(
1279
1279
  const actualUnits = resolveUnits(propType, enablePropTypeUnits, variant, units2, actualExtendedOptions);
1280
1280
  const popupState = (0, import_ui14.usePopupState)({ variant: "popover" });
1281
1281
  const memorizedExternalState = (0, import_react14.useMemo)(
1282
- () => sizeValue ? createStateFromSizeProp(sizeValue, actualDefaultUnit) : null,
1282
+ () => createStateFromSizeProp(sizeValue, actualDefaultUnit),
1283
1283
  [sizeValue, actualDefaultUnit]
1284
1284
  );
1285
1285
  const [state, setState] = useSyncExternalState({
@@ -1293,12 +1293,6 @@ var SizeControl = createControl(
1293
1293
  })
1294
1294
  });
1295
1295
  const { size: controlSize = DEFAULT_SIZE, unit: controlUnit = actualDefaultUnit } = extractValueFromState(state, true) || {};
1296
- const handleBlur = () => {
1297
- if (!extractValueFromState(state)) {
1298
- setState((prev) => ({ ...prev, unit: actualDefaultUnit }));
1299
- }
1300
- restoreValue();
1301
- };
1302
1296
  const handleUnitChange = (newUnit) => {
1303
1297
  if (newUnit === "custom") {
1304
1298
  popupState.open(anchorRef?.current);
@@ -1346,7 +1340,7 @@ var SizeControl = createControl(
1346
1340
  startIcon,
1347
1341
  handleSizeChange,
1348
1342
  handleUnitChange,
1349
- onBlur: handleBlur,
1343
+ onBlur: restoreValue,
1350
1344
  onClick: onInputClick,
1351
1345
  popupState,
1352
1346
  min,