fis-component 0.0.96 → 0.0.97
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/cjs/index.js +10 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -71326,6 +71326,12 @@ const FISInputDate = React.forwardRef((props, ref) => {
|
|
|
71326
71326
|
return;
|
|
71327
71327
|
const newInputValue = e.target.value;
|
|
71328
71328
|
setInputValue(newInputValue);
|
|
71329
|
+
// Handle empty input - user wants to clear the date
|
|
71330
|
+
if (newInputValue === "") {
|
|
71331
|
+
setDateValue(null);
|
|
71332
|
+
onChange?.(null);
|
|
71333
|
+
return;
|
|
71334
|
+
}
|
|
71329
71335
|
// Try to parse the input as a date
|
|
71330
71336
|
const parsedDate = dayjs(newInputValue, finalFormat);
|
|
71331
71337
|
if (parsedDate.isValid()) {
|
|
@@ -71340,6 +71346,10 @@ const FISInputDate = React.forwardRef((props, ref) => {
|
|
|
71340
71346
|
if (originalOnBlur) {
|
|
71341
71347
|
originalOnBlur(e);
|
|
71342
71348
|
}
|
|
71349
|
+
// Don't revert if input is empty (user intentionally cleared)
|
|
71350
|
+
if (inputValue === "") {
|
|
71351
|
+
return;
|
|
71352
|
+
}
|
|
71343
71353
|
// On blur, if input format is invalid, revert to the current date value's formatted string
|
|
71344
71354
|
const parsedDate = dayjs(inputValue, finalFormat);
|
|
71345
71355
|
if (!parsedDate.isValid() && dateValue) {
|