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

Fix navigation when value is outside allowed range #1084

Open
wants to merge 1 commit into
base: v4-stable
Choose a base branch
from

Conversation

josalmi
Copy link

@josalmi josalmi commented Jun 17, 2021

React widgets v5 example below where this is also an issue:

<DatePicker 
  min={new Date(2021,10,30)}
  defaultValue={new Date(2021, 5, 20)}
/>;

We are however using V4 and its time picker and would appreciate if this can get patched there as well without having to create a fork. In short, when value is outside the range of min and max, you cannot navigate to other months until the value is within the range. The check inside componentDidMount will always fail and set current date back to to the min or max.

I believe this code was somewhat ported to V5 here: https://github.com/jquense/react-widgets/blob/master/packages/react-widgets/src/Calendar.tsx#L377-L385 and a similar change would suffice.

React widgets v5 example below where this is also an issue:
```
<DatePicker 
  min={new Date(2021,10,30)}
  defaultValue={new Date(2021, 5, 20)}
/>;
```

We are however using V4 and its time picker and would appreciate if this can get patched there as well without having to create a fork.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant