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
isOutsideRange property ends up nullifying invalid dates entirely #2240
Comments
What change would you suggest that wouldn't be semver-major? |
@ljharb potentially adding an additional optionally accessible parameter to the
|
Let's keep this open for the onClose change. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
react-dates version
react-dates@21.8.0
Describe the bug
Using
isOutsideRange
prop will completely remove an invalid date when a date outside the range is manually typed in. This prevents us from handling invalid inputs with validation schemas like Yup and creating better error messaging experiences for our app.Source code (including props configuration)
We recommend checking out this CodeSandbox to see the other libraries we use in conjunction with SDP.
https://codesandbox.io/s/single-date-picker-range-validation-reproducible-chrrlt?file=/src/Form.jsx:1707-2451
Steps to reproduce the behavior:
Screenshots/Gifs
Kapture.2023-09-07.at.12.28.50.mp4
Desktop (please complete the following information):
Is the issue reproducible in Storybook?
Yes, but it's not apparent what happens under the scenes. The text remains, but the value is not stored.
https://react-dates.github.io/react-dates/?path=/story/sdp-day-props--allows-next-two-weeks-only
Additional context
We're aware this isn't necessarily a bug, but the pattern here feels incorrect. The library should allow developers to decide how they want to handle invalid inputs. Blanket removing all invalid inputs leads to some confusing and vague behaviors.
The text was updated successfully, but these errors were encountered: