Skip to content

Commit

Permalink
fix: wrong validation state in date range picker & reexport it (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraghazra authored Oct 16, 2020
1 parent e4b8bb9 commit 584fae5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/datepicker/DateRangePickerState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ export const useDateRangePickerState = (
parseDate(props.maxValue),
);

const validationState: ValidationState | null =
const validationState: ValidationState =
props.validationState ||
(value != null &&
(isStartInRange ||
isEndInRange ||
(value.end != null && value.start != null && value.end < value.start))
? "invalid"
: null);
: "valid");

React.useEffect(() => {
if (popover.visible) {
Expand Down
1 change: 1 addition & 0 deletions src/datepicker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from "./DatePickerState";
export * from "./DatePickerSegmentField";
export * from "./DatePickerTrigger";
export * from "./DatePickerContent";
export * from "./DateRangePickerState";

0 comments on commit 584fae5

Please sign in to comment.