@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.cjs
CHANGED
|
@@ -12996,6 +12996,7 @@ function NumberField(props) {
|
|
|
12996
12996
|
wip: false
|
|
12997
12997
|
});
|
|
12998
12998
|
const lastSentRef = (0, import_react54.useRef)(void 0);
|
|
12999
|
+
const focusValueRef = (0, import_react54.useRef)(void 0);
|
|
12999
13000
|
const [, forceRender] = (0, import_react54.useState)(0);
|
|
13000
13001
|
const propValue = value === void 0 ? Number.NaN : value / factor;
|
|
13001
13002
|
if (valueRef.current.wip && !Object.is(valueRef.current.value, propValue)) {
|
|
@@ -13011,7 +13012,7 @@ function NumberField(props) {
|
|
|
13011
13012
|
// // This is called on blur with the final/committed value.
|
|
13012
13013
|
onChange: (value2) => {
|
|
13013
13014
|
const formatted = formatValue(value2, factor, numFractionDigits, numIntegerDigits, positiveOnly);
|
|
13014
|
-
if (formatted !== lastSentRef.current) return;
|
|
13015
|
+
if (formatted !== lastSentRef.current && formatted === focusValueRef.current) return;
|
|
13015
13016
|
onChange(formatted);
|
|
13016
13017
|
},
|
|
13017
13018
|
onFocus: () => {
|
|
@@ -13020,6 +13021,7 @@ function NumberField(props) {
|
|
|
13020
13021
|
value: value === void 0 ? Number.NaN : value / factor
|
|
13021
13022
|
};
|
|
13022
13023
|
lastSentRef.current = value;
|
|
13024
|
+
focusValueRef.current = value;
|
|
13023
13025
|
},
|
|
13024
13026
|
onBlur: () => {
|
|
13025
13027
|
valueRef.current = {
|