react-component / react-component/picker
When selecting values in panel with type different than the picker type dates are auto-selected.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 304
- Forks
- 345
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 7
Description
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);,.
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
I've also open a PR with possible way of fixing the issue and test that can simulate it in master https://github.com/react-component/picker/pull/788
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at triggerCalendarChange and the useInnerValue hook, especially the calendarValue update described in the issue. Reproduce the year and decade selections through the multiple Storybook story, then use the referenced PR and its test as context. Done means selecting a different panel type does not auto-select a date or populate the input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100