@elementor/editor-controls 4.1.0-782 → 4.1.0-784

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
- () => createStateFromSizeProp(sizeValue, actualDefaultUnit),
1282
+ () => sizeValue ? createStateFromSizeProp(sizeValue, actualDefaultUnit) : null,
1283
1283
  [sizeValue, actualDefaultUnit]
1284
1284
  );
1285
1285
  const [state, setState] = useSyncExternalState({
@@ -1293,6 +1293,12 @@ 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
+ };
1296
1302
  const handleUnitChange = (newUnit) => {
1297
1303
  if (newUnit === "custom") {
1298
1304
  popupState.open(anchorRef?.current);
@@ -1340,7 +1346,7 @@ var SizeControl = createControl(
1340
1346
  startIcon,
1341
1347
  handleSizeChange,
1342
1348
  handleUnitChange,
1343
- onBlur: restoreValue,
1349
+ onBlur: handleBlur,
1344
1350
  onClick: onInputClick,
1345
1351
  popupState,
1346
1352
  min,
@@ -4199,6 +4205,7 @@ var RestrictedLinkInfotip = ({
4199
4205
  {
4200
4206
  color: "secondary",
4201
4207
  icon: /* @__PURE__ */ React68.createElement(import_icons14.InfoCircleFilledIcon, null),
4208
+ size: "small",
4202
4209
  action: /* @__PURE__ */ React68.createElement(
4203
4210
  import_ui51.AlertAction,
4204
4211
  {