@asantemedia-org/edwardsvacuum-design-system 1.6.65 → 1.6.66
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.css +0 -3
- package/dist/index.esm.css +0 -3
- package/dist/index.esm.js +17 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/dist/index.scss +0 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -390,14 +390,28 @@ var FacetUnitSelector = function (_a) {
|
|
|
390
390
|
var _c = React.useState(0),
|
|
391
391
|
selectedIndex = _c[0],
|
|
392
392
|
setSelectedIndex = _c[1];
|
|
393
|
+
var isChanging = React.useRef(false);
|
|
393
394
|
var getClassName = function (name) {
|
|
394
395
|
return usePlainClasses ? name : getStyle$2(name);
|
|
395
396
|
};
|
|
396
397
|
if (!entries || entries.length === 0) return null;
|
|
397
398
|
var selectedEntry = entries[selectedIndex];
|
|
398
|
-
var handleUnitChange = function (e) {
|
|
399
|
-
|
|
400
|
-
|
|
399
|
+
var handleUnitChange = React.useCallback(function (e) {
|
|
400
|
+
// Stop event propagation to prevent AEM handlers
|
|
401
|
+
e.stopPropagation();
|
|
402
|
+
// Prevent multiple rapid changes
|
|
403
|
+
if (isChanging.current) return;
|
|
404
|
+
isChanging.current = true;
|
|
405
|
+
var newIndex = Number(e.target.value);
|
|
406
|
+
// Use requestAnimationFrame to defer state update
|
|
407
|
+
requestAnimationFrame(function () {
|
|
408
|
+
setSelectedIndex(newIndex);
|
|
409
|
+
// Reset change lock
|
|
410
|
+
setTimeout(function () {
|
|
411
|
+
isChanging.current = false;
|
|
412
|
+
}, 100);
|
|
413
|
+
});
|
|
414
|
+
}, []);
|
|
401
415
|
return /*#__PURE__*/React.createElement("div", {
|
|
402
416
|
className: getClassName("facet-unit-selector")
|
|
403
417
|
}, /*#__PURE__*/React.createElement("span", {
|