@lime-bundles/react 7.2.0 → 7.3.0
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.cjs +11 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3155,6 +3155,17 @@ function MultiStepPicker({
|
|
|
3155
3155
|
}
|
|
3156
3156
|
return front.concat(back);
|
|
3157
3157
|
}, [eligible, selectedAtLoad]);
|
|
3158
|
+
const autoAdvance = wc.multiStepAutoAdvance === true;
|
|
3159
|
+
const lastSeen = useRef7({ step: stepIndex, units: unitsInStep });
|
|
3160
|
+
useEffect14(() => {
|
|
3161
|
+
const prev = lastSeen.current;
|
|
3162
|
+
lastSeen.current = { step: stepIndex, units: unitsInStep };
|
|
3163
|
+
if (!autoAdvance || isLastStep || prev.step !== stepIndex) return;
|
|
3164
|
+
if (unitsInStep <= prev.units) return;
|
|
3165
|
+
if (stepHeadroom(step?.maxQuantity ?? null, unitsInStep) === 0) {
|
|
3166
|
+
goToStep(stepIndex + 1);
|
|
3167
|
+
}
|
|
3168
|
+
});
|
|
3158
3169
|
function goToStep(i) {
|
|
3159
3170
|
const clamped = Math.max(0, Math.min(steps.length - 1, i));
|
|
3160
3171
|
setStepIndex(clamped);
|