Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass isOutsideRange prop to input controller #1370

Merged
merged 2 commits into from
Sep 23, 2018

Conversation

kristofferh
Copy link
Contributor

Description

The SingleDatePicker component isn't passing the isOutsideRange prop down to the SingleDatePickerInputController so SingleDatePickerInputController ends up using the default range. This results in valid dates outside in the past to not get recognized by the calendar. By passing the prop down we can allow for dates in the past. You can see the behavior by entering in a date in the past in the Storybook example (notice it doesn't highlight the past-date - it does work for days in the future).

Before

After

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but it’d be great to add a test for this.

@coveralls
Copy link

coveralls commented Sep 21, 2018

Coverage Status

Coverage remained the same at 84.978% when pulling 341142c on kristofferh:kris/valid-dates-in-past into 5c5d356 on airbnb:master.

@kristofferh
Copy link
Contributor Author

@ljharb Updated with test. Thanks for reviewing!

@ljharb ljharb requested a review from majapw September 21, 2018 19:46
@ljharb ljharb added the semver-minor: new stuff Any feature or API addition. label Sep 21, 2018
Copy link
Collaborator

@majapw majapw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for catching this! :)

@majapw majapw merged commit 6860b21 into react-dates:master Sep 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor: new stuff Any feature or API addition.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants