@homebound/beam 3.0.4 → 3.0.5
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 +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12591,6 +12591,7 @@ function NumberField(props) {
|
|
|
12591
12591
|
wip: false
|
|
12592
12592
|
});
|
|
12593
12593
|
const lastSentRef = useRef27(void 0);
|
|
12594
|
+
const focusValueRef = useRef27(void 0);
|
|
12594
12595
|
const [, forceRender] = useState23(0);
|
|
12595
12596
|
const propValue = value === void 0 ? Number.NaN : value / factor;
|
|
12596
12597
|
if (valueRef.current.wip && !Object.is(valueRef.current.value, propValue)) {
|
|
@@ -12606,7 +12607,7 @@ function NumberField(props) {
|
|
|
12606
12607
|
// // This is called on blur with the final/committed value.
|
|
12607
12608
|
onChange: (value2) => {
|
|
12608
12609
|
const formatted = formatValue(value2, factor, numFractionDigits, numIntegerDigits, positiveOnly);
|
|
12609
|
-
if (formatted !== lastSentRef.current) return;
|
|
12610
|
+
if (formatted !== lastSentRef.current && formatted === focusValueRef.current) return;
|
|
12610
12611
|
onChange(formatted);
|
|
12611
12612
|
},
|
|
12612
12613
|
onFocus: () => {
|
|
@@ -12615,6 +12616,7 @@ function NumberField(props) {
|
|
|
12615
12616
|
value: value === void 0 ? Number.NaN : value / factor
|
|
12616
12617
|
};
|
|
12617
12618
|
lastSentRef.current = value;
|
|
12619
|
+
focusValueRef.current = value;
|
|
12618
12620
|
},
|
|
12619
12621
|
onBlur: () => {
|
|
12620
12622
|
valueRef.current = {
|