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

[pickers] Fix DateCalendar crashing when given an invalid value #11101

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Nov 20, 2023

Fixes #11062

Does not occur in v7 because focusedDay is initialized to equal referenceDate which does a similar test.

Once focusedDay contains an invalid date, it is passed to findClosestEnabledDate in DayCalendar and the method does not like it.

@flaviendelangle flaviendelangle added bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! labels Nov 20, 2023
@flaviendelangle flaviendelangle self-assigned this Nov 20, 2023
@mui-bot
Copy link

mui-bot commented Nov 20, 2023

Deploy preview: https://deploy-preview-11101--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against a1414d3

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

The fix makes sense. 👌

P.S. I'm renaming the PR, because we do not have a DateCalendar case in our changelog generation pipeline mapping it to the pickers changes. 🙈

@LukasTy LukasTy changed the title [DateCalendar] Should not crash when given an invalid value [pickers] Fix DateCalendar crashing when given an invalid value Nov 20, 2023
@flaviendelangle flaviendelangle merged commit 4d0ec88 into mui:master Nov 20, 2023
21 checks passed
@flaviendelangle flaviendelangle deleted the crash-invalid-value branch November 20, 2023 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants