#6294: 🐛 Fix inline range datepicker resetting selection on handleSelect#81
Open
balajis-qb wants to merge 1 commit into
Open
#6294: 🐛 Fix inline range datepicker resetting selection on handleSelect#81balajis-qb wants to merge 1 commit into
balajis-qb wants to merge 1 commit into
Conversation
… on handleSelect Avoid calling setOpen(false) inside handleSelect when the datepicker is in inline mode. Inline pickers do not close, but triggering setOpen(false) causes a focus reset that switches selection back to startDate, effectively losing the current range selection. This change ensures that inline range pickers preserve the active selection state while maintaining existing behavior for non-inline modes. Fixes Hacker0x01#6294
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Linked issue: Hacker0x01#6294
Problem
The handleSelect handler unconditionally calls
setOpen(false). While this behavior is correct for non-inline datepickers (which should close after selection), it causes unintended side effects in inline mode.Inline datepickers do not close, but invoking
setOpen(false)still triggers a focus reset. This results in the component switching back to selectingstartDate, effectively losing the current range selection and creating a broken user experience.Changes
setOpen(false)when the datepicker is in inline modeBehavior Changes
Contribution checklist