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/esm/index.js CHANGED
@@ -71306,6 +71306,12 @@ const FISInputDate = forwardRef((props, ref) => {
71306
71306
  return;
71307
71307
  const newInputValue = e.target.value;
71308
71308
  setInputValue(newInputValue);
71309
+ // Handle empty input - user wants to clear the date
71310
+ if (newInputValue === "") {
71311
+ setDateValue(null);
71312
+ onChange?.(null);
71313
+ return;
71314
+ }
71309
71315
  // Try to parse the input as a date
71310
71316
  const parsedDate = dayjs(newInputValue, finalFormat);
71311
71317
  if (parsedDate.isValid()) {
@@ -71320,6 +71326,10 @@ const FISInputDate = forwardRef((props, ref) => {
71320
71326
  if (originalOnBlur) {
71321
71327
  originalOnBlur(e);
71322
71328
  }
71329
+ // Don't revert if input is empty (user intentionally cleared)
71330
+ if (inputValue === "") {
71331
+ return;
71332
+ }
71323
71333
  // On blur, if input format is invalid, revert to the current date value's formatted string
71324
71334
  const parsedDate = dayjs(inputValue, finalFormat);
71325
71335
  if (!parsedDate.isValid() && dateValue) {