-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix DatePicker year picker crash in range mode #8469
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
base: v11
Are you sure you want to change the base?
Fix DatePicker year picker crash in range mode #8469
Conversation
|
@ThiagoBarbosaDev thanks for the clear bug report and repro steps — they helped a lot. I’ve submitted a fix handling range values correctly in the year picker. Please feel free to verify and let me know if any adjustments are needed. |
x10vaishnavi
left a comment
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.
Looked through the changes — handling the array cases before the single date logic is the right call.
This will really avoids the crash and keeps the year picking logic clean..
|
Assigned to PrimeTek to review |
Thanks for the update. Happy to wait for the PrimeTek review. |
|
@Coderxrohan much appreciated all your work and your thorough explanations! They really help maintainers. |
|
Hi @tanerengiiin / PrimeTek team, |
|
@Coderxrohan looks like you have a merge conflict? |
933b9e6 to
1f8222c
Compare
Hi @melloware, I’ve rebased the branch on the latest v11 and resolved the merge state. |
Issue:
In DatePicker range mode, the selected value is an array (
[startDate, endDate] or [Date, null]), but year-selection logic treated it as a single Date. This causedgetFullYear()to be called on non-Date values, resulting in a runtime crash when opening the year picker.Fix:
Updated the year-selection logic to correctly handle array-based values by normalizing the selection before accessing year data. Array (
range/multiple) cases are now handled beforesingle-date logic, ensuring getFullYear()is only called on valid Date instances.Fixes #8468
([v11] Datepicker: Error when trying to select the year after selecting a date in range mode.)