react-component / react-component/picker
Users can't reset their panel navigations
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 304
- Forks
- 345
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 7
Description
Use case:
The user opens the picker popup, clicks on the month (switches mode to month panel), clicks some arrows (year changes), the user panics and wants to get back to original calendar view. The user clicks outside of the picker popup, causing the popup to close. Now the user expects to reopen it again in its original state.
Problem:
The picker opens in the state it was left in. It opens the last used panel, not the default "date" panel. If defaultValue is unset, it opens the last year navigated to as well.
This is a usability regression in ant-design 4. It was working fine in ant3.
Expected:
When a user cancels date picking by closing and reopening a panel, all settings should be as they were before the user did anything. Users are easily confused and expect a complete cancel functionality.
Solution:
Picker should create a new PickerPanel (e.g. by generating a new component's key). Alternatively, PickerPanel could expose a 'reset' method to set panel mode and inner view date back to their default values.
The reset should be a side effect of Picker's 'triggerInnerOpen'. Same for RangePicker.
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 Picker's triggerInnerOpen behavior and inspect how PickerPanel preserves its panel mode and inner view date after closing. Check the corresponding RangePicker path as well. Done means reopening after cancellation restores the default date panel and original view date, including when defaultValue is unset.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100