react-component / react-component/picker
onCalendarChange is called with wrong value if only one value set in RangePicker
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 304
- Forks
- 345
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 7
Description
In RangePicker when both start and end values are selected, if the user changes only the end value and clicks outside, the value is correctly set to [oldStartValue, newEndValue] but onCalendarChange is called after onChange with the wrong values [oldStartValue, oldEndValue]
Here is the reproduction:
https://codesandbox.io/p/sandbox/cocky-tamas-fflnh2
Here is a screenshot:
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 with the RangePicker behavior described in the linked CodeSandbox reproduction and trace the callback sequence when both values exist but only the end value changes. Reproduce the case, then verify that onCalendarChange receives the updated range rather than the old values after onChange.
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
- Mostly clear
- Newbie friendliness
- 45/100