-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[date picker] Fix shouldDisableDate
in range pickers
#5123
Conversation
@@ -229,6 +229,7 @@ function DateRangePickerViewRaw<TInputDate, TDate>( | |||
disablePast, | |||
minDate, | |||
maxDate, | |||
shouldDisableDate, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part of the code is very error-prone, maybe we could improve it later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have an idea about how to improve it? I only see two ways:
- Use providers to avoid having to propagate the information, and forget them somewhere
- make tests that loop on all the exported components to check we do not break props propagation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have an idea about how to improve it? I only see two ways:
- Use providers to avoid having to propagate the information, and forget them somewhere
- make tests that loop on all the exported components to check we do not break props propagation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not think about it in depth tbh
We could indeed have a conformance test taking a component, 2-3 callbacks to interact with the DOM and which tests all the validation props (it would at least be a subset of our problem)
These are the results for the performance tests:
|
shouldDisableDate
in range pickers
Fixes #5111