Skip to content

Fix navigation when value is outside allowed range#1084

Open
josalmi wants to merge 1 commit intojquense:v4-stablefrom
josalmi:josalmi-patch-1
Open

Fix navigation when value is outside allowed range#1084
josalmi wants to merge 1 commit intojquense:v4-stablefrom
josalmi:josalmi-patch-1

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