@react-aria/datepicker 3.6.0 → 3.7.0

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/module.js CHANGED
@@ -814,6 +814,7 @@ function $3dfb0f96be0d6a08$export$4a931266a3838b86(state, ref, disableArrowNavig
814
814
  ]);
815
815
  // Open the popover on alt + arrow down
816
816
  let onKeyDown = (e)=>{
817
+ if (!e.currentTarget.contains(e.target)) return;
817
818
  if (e.altKey && (e.key === "ArrowDown" || e.key === "ArrowUp") && "setOpen" in state) {
818
819
  e.preventDefault();
819
820
  e.stopPropagation();
@@ -1061,7 +1062,7 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
1061
1062
  isDisabled: props.isDisabled,
1062
1063
  isReadOnly: props.isReadOnly,
1063
1064
  isRequired: props.isRequired,
1064
- validationState: state.validationState,
1065
+ isInvalid: state.isInvalid,
1065
1066
  autoFocus: props.autoFocus,
1066
1067
  name: props.name
1067
1068
  },
@@ -1091,7 +1092,7 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
1091
1092
  isReadOnly: props.isReadOnly,
1092
1093
  isDateUnavailable: props.isDateUnavailable,
1093
1094
  defaultFocusedValue: state.dateValue ? undefined : props.placeholderValue,
1094
- validationState: state.validationState,
1095
+ isInvalid: state.isInvalid,
1095
1096
  errorMessage: props.errorMessage
1096
1097
  }
1097
1098
  };
@@ -1423,7 +1424,7 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
1423
1424
  let firstSegment = (0, $cIPI0$useMemo)(()=>state.segments.find((s)=>s.isEditable), [
1424
1425
  state.segments
1425
1426
  ]);
1426
- if (segment !== firstSegment && state.validationState !== "invalid") ariaDescribedBy = undefined;
1427
+ if (segment !== firstSegment && !state.isInvalid) ariaDescribedBy = undefined;
1427
1428
  let id = (0, $cIPI0$useId)();
1428
1429
  let isEditable = !state.isDisabled && !state.isReadOnly && segment.isEditable;
1429
1430
  // Prepend the label passed from the field to each segment name.
@@ -1444,7 +1445,7 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
1444
1445
  segmentProps: (0, $cIPI0$mergeProps)(spinButtonProps, labelProps, {
1445
1446
  id: id,
1446
1447
  ...touchPropOverrides,
1447
- "aria-invalid": state.validationState === "invalid" ? "true" : undefined,
1448
+ "aria-invalid": state.isInvalid ? "true" : undefined,
1448
1449
  "aria-describedby": ariaDescribedBy,
1449
1450
  "aria-readonly": state.isReadOnly || !segment.isEditable ? "true" : undefined,
1450
1451
  "data-placeholder": segment.isPlaceholder || undefined,
@@ -1557,7 +1558,7 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
1557
1558
  isDisabled: props.isDisabled,
1558
1559
  isReadOnly: props.isReadOnly,
1559
1560
  isRequired: props.isRequired,
1560
- validationState: state.validationState
1561
+ isInvalid: state.isInvalid
1561
1562
  };
1562
1563
  let domProps = (0, $cIPI0$filterDOMProps)(props);
1563
1564
  let { focusWithinProps: focusWithinProps } = (0, $cIPI0$useFocusWithin)({
@@ -1629,7 +1630,7 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
1629
1630
  isDateUnavailable: props.isDateUnavailable,
1630
1631
  allowsNonContiguousRanges: props.allowsNonContiguousRanges,
1631
1632
  defaultFocusedValue: state.dateRange ? undefined : props.placeholderValue,
1632
- validationState: state.validationState,
1633
+ isInvalid: state.isInvalid,
1633
1634
  errorMessage: props.errorMessage
1634
1635
  }
1635
1636
  };