@dmsi/wedgekit-react 0.0.444 → 0.0.446
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.
|
@@ -5430,7 +5430,10 @@ var DateRangeInput = (_a) => {
|
|
|
5430
5430
|
const [from, to] = value.split("|");
|
|
5431
5431
|
(0, import_react38.useEffect)(() => {
|
|
5432
5432
|
if (!isTyping) {
|
|
5433
|
-
|
|
5433
|
+
const displayValue = formatDisplayValue(from, to);
|
|
5434
|
+
if (displayValue) {
|
|
5435
|
+
setInputValue(displayValue);
|
|
5436
|
+
}
|
|
5434
5437
|
}
|
|
5435
5438
|
}, [from, to, isTyping, disableRange]);
|
|
5436
5439
|
(0, import_react38.useLayoutEffect)(() => {
|
|
@@ -122,7 +122,10 @@ var DateRangeInput = (_a) => {
|
|
|
122
122
|
const [from, to] = value.split("|");
|
|
123
123
|
useEffect(() => {
|
|
124
124
|
if (!isTyping) {
|
|
125
|
-
|
|
125
|
+
const displayValue = formatDisplayValue(from, to);
|
|
126
|
+
if (displayValue) {
|
|
127
|
+
setInputValue(displayValue);
|
|
128
|
+
}
|
|
126
129
|
}
|
|
127
130
|
}, [from, to, isTyping, disableRange]);
|
|
128
131
|
useLayoutEffect(() => {
|
package/package.json
CHANGED
|
@@ -74,7 +74,12 @@ export const DateRangeInput = ({
|
|
|
74
74
|
// Update input value when external value changes (but not when typing)
|
|
75
75
|
useEffect(() => {
|
|
76
76
|
if (!isTyping) {
|
|
77
|
-
|
|
77
|
+
// Only update inputValue if the value is valid
|
|
78
|
+
const displayValue = formatDisplayValue(from, to);
|
|
79
|
+
if (displayValue) {
|
|
80
|
+
setInputValue(displayValue);
|
|
81
|
+
}
|
|
82
|
+
// If displayValue is empty, keep previous inputValue unchanged
|
|
78
83
|
}
|
|
79
84
|
}, [from, to, isTyping, disableRange]);
|
|
80
85
|
|