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