@abgov/react-components 5.0.0-alpha.4 → 5.0.0-alpha.5

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/index.mjs CHANGED
@@ -535,7 +535,8 @@ function GoADatePicker({
535
535
  }
536
536
  const current = ref.current;
537
537
  const handleChange = (e) => {
538
- onChange(name || "", e.detail.value);
538
+ const newValue = e.detail.value;
539
+ onChange(name || "", newValue ? new Date(newValue) : void 0);
539
540
  };
540
541
  current.addEventListener("_change", handleChange);
541
542
  return () => {
@@ -547,7 +548,7 @@ function GoADatePicker({
547
548
  {
548
549
  ref,
549
550
  name,
550
- value: value == null ? void 0 : value.toISOString(),
551
+ value: (value == null ? void 0 : value.toISOString()) || "",
551
552
  error,
552
553
  disabled,
553
554
  min: min == null ? void 0 : min.toISOString(),