@jsenv/navi 0.29.17 → 0.29.18

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.
@@ -53569,7 +53569,14 @@ const Spin = ({
53569
53569
  // and this reads the answer back. Nothing of that story is told twice.
53570
53570
  const controlRef = useRef();
53571
53571
  const middleRef = useRef();
53572
- const valueShown = useControlUIState(controlRef, value ?? defaultValue ?? signalProp?.peek()) ?? fallbackValue;
53572
+ const valueHeld = useControlUIState(controlRef, value ?? defaultValue ?? signalProp?.peek());
53573
+ // A spin always shows a value, and empty is not one: the calendar has an
53574
+ // "erase" in it, and what comes back from it is "" rather than nothing —
53575
+ // which is a value as far as `??` is concerned and is not one as far as
53576
+ // `valueAtStep` is (a day made of an empty string is an invalid date, and
53577
+ // stepping away from it writes NaN into the control). So the fallback is
53578
+ // asked for here, once, for every kind of value a spin steps through.
53579
+ const valueShown = valueHeld === undefined || valueHeld === null || valueHeld === "" ? fallbackValue : valueHeld;
53573
53580
 
53574
53581
  // …and the other way round when a signal was handed over: a bound signal is
53575
53582
  // the value, wherever it is moved from — the url, a back/forward, a button