@elementor/editor-controls 3.35.0-469 → 3.35.0-470

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
@@ -1355,8 +1355,21 @@ var RepeaterContextProvider = ({
1355
1355
  persistWhen: () => true
1356
1356
  });
1357
1357
  const [uniqueKeys, setUniqueKeys] = (0, import_react17.useState)(() => {
1358
- return items2?.map((_, index) => index) ?? [];
1358
+ return items2?.map(() => generateUniqueKey()) ?? [];
1359
1359
  });
1360
+ React25.useEffect(() => {
1361
+ const nextLength = items2?.length ?? 0;
1362
+ setUniqueKeys((prev) => {
1363
+ const prevLength = prev.length;
1364
+ if (prevLength === nextLength) {
1365
+ return prev;
1366
+ }
1367
+ if (prevLength > nextLength) {
1368
+ return prev.slice(0, nextLength);
1369
+ }
1370
+ return [...prev, ...Array.from({ length: nextLength - prevLength }, generateUniqueKey)];
1371
+ });
1372
+ }, [items2?.length]);
1360
1373
  const itemsWithKeys = (0, import_react17.useMemo)(
1361
1374
  () => uniqueKeys.map((key, index) => ({
1362
1375
  key,