@axinom/mosaic-ui 0.62.0-rc.3 → 0.62.0-rc.4
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/components/FormElements/DateTimeField/DateTimeText.d.ts.map +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/FormElements/DateTimeField/DateTimeText.tsx +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-ui",
|
|
3
|
-
"version": "0.62.0-rc.
|
|
3
|
+
"version": "0.62.0-rc.4",
|
|
4
4
|
"description": "UI components for building Axinom Mosaic applications",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"publishConfig": {
|
|
113
113
|
"access": "public"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "ecaf0b08f61ddda4c1100c85bbd076f2f30fddb6"
|
|
116
116
|
}
|
|
@@ -60,6 +60,13 @@ export const DateTimeText: React.FC<DateTimeTextProps> = ({
|
|
|
60
60
|
|
|
61
61
|
const onBlurHandler = useCallback(
|
|
62
62
|
(e: React.FocusEvent<HTMLInputElement>) => {
|
|
63
|
+
// `display` represents the formatted version of the `value` prop and is updated whenever `value` changes.
|
|
64
|
+
// Comparing `e.target.value` with `display` ensures that onChange is only triggered when the input value has changed.
|
|
65
|
+
if (e.target.value === display) {
|
|
66
|
+
// If the value hasn't changed, do not trigger onChange
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
63
70
|
const textValue = e.target.value;
|
|
64
71
|
const parsedValue = modifyTime
|
|
65
72
|
? DateTime.fromFormat(textValue, 'f')
|
|
@@ -80,7 +87,7 @@ export const DateTimeText: React.FC<DateTimeTextProps> = ({
|
|
|
80
87
|
}
|
|
81
88
|
}
|
|
82
89
|
},
|
|
83
|
-
[modifyTime, onChange],
|
|
90
|
+
[display, modifyTime, onChange],
|
|
84
91
|
);
|
|
85
92
|
|
|
86
93
|
return (
|