@homebound/beam 3.0.1 → 3.0.2
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 +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +65 -61
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -12972,6 +12972,7 @@ function NumberField(props) {
|
|
|
12972
12972
|
wip: false
|
|
12973
12973
|
});
|
|
12974
12974
|
const lastSentRef = (0, import_react54.useRef)(void 0);
|
|
12975
|
+
const [, forceRender] = (0, import_react54.useState)(0);
|
|
12975
12976
|
const propValue = value === void 0 ? Number.NaN : value / factor;
|
|
12976
12977
|
if (valueRef.current.wip && !Object.is(valueRef.current.value, propValue)) {
|
|
12977
12978
|
const lastSentInternal = lastSentRef.current === void 0 ? Number.NaN : lastSentRef.current / factor;
|
|
@@ -12985,7 +12986,9 @@ function NumberField(props) {
|
|
|
12985
12986
|
value: valueRef.current.wip ? valueRef.current.value : value === void 0 ? Number.NaN : value / factor,
|
|
12986
12987
|
// // This is called on blur with the final/committed value.
|
|
12987
12988
|
onChange: (value2) => {
|
|
12988
|
-
|
|
12989
|
+
const formatted = formatValue(value2, factor, numFractionDigits, numIntegerDigits, positiveOnly);
|
|
12990
|
+
if (formatted !== lastSentRef.current) return;
|
|
12991
|
+
onChange(formatted);
|
|
12989
12992
|
},
|
|
12990
12993
|
onFocus: () => {
|
|
12991
12994
|
valueRef.current = {
|
|
@@ -12999,6 +13002,7 @@ function NumberField(props) {
|
|
|
12999
13002
|
wip: false
|
|
13000
13003
|
};
|
|
13001
13004
|
lastSentRef.current = void 0;
|
|
13005
|
+
forceRender((c) => c + 1);
|
|
13002
13006
|
},
|
|
13003
13007
|
onKeyDown: (e) => {
|
|
13004
13008
|
if (e.key === "Enter") {
|