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

fix: Picker shouldn't autoselect values on picking dates in different picker panel mode that the original picker mode #788

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DimitrovDev89
Copy link

Currently when we have date picker with type = date and switch the panel mode selection through the popup to month and then year and then select an year from that picker to narrow down the date selection, triggerCalendarChange function is called, even though the picker mode is date, which causes the date associated with the year(01-01-year) to be auto-selected and shown in the input. There is also a comment on triggerCalendarChange, which says // Only trigger calendar event but not update internal calendarValue state, but triggerCalendarChange does update the calendarValue internally in useInnerValue hook line 147 - setCalendarValue(clone);.
A fix to the issue would be to not trigger the calendar change until the panel and picker modes are the same.

Using the multiple storybook where we have date picker and navigating to decade panel and selecting 2000-2009, causes value 2000-04-08 to be auto-selected as first multiples value
image
image

Copy link

vercel bot commented Apr 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
picker ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2024 10:25am

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