Skip to content

Fix #6294: 🐛 Fix inline range datepicker resetting selection on handleSelect#6296

Open
balajis-qb wants to merge 1 commit into
Hacker0x01:mainfrom
qburst:issue-6294/fix/range-datepicker-inline-reset
Open

Fix #6294: 🐛 Fix inline range datepicker resetting selection on handleSelect#6296
balajis-qb wants to merge 1 commit into
Hacker0x01:mainfrom
qburst:issue-6294/fix/range-datepicker-inline-reset

Conversation

@balajis-qb

@balajis-qb balajis-qb commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Description

Linked issue: #6294 & #6304

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 selecting startDate, effectively losing the current range selection and creating a broken user experience.

Changes

  • Added a conditional check to skip calling setOpen(false) when the datepicker is in inline mode
  • Preserved existing behavior for non-inline datepickers
  • Prevented unnecessary focus resets that were causing selection state loss

Behavior Changes

  • Inline mode: Range selection is preserved correctly after selecting dates
  • Non-inline mode: No change; picker continues to close after selection

Contribution checklist

  • I have followed the contributing guidelines.
  • I have added sufficient test coverage for my changes.
  • I have formatted my code with Prettier and checked for linting issues with ESLint for code readability.

… 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
@balajis-qb balajis-qb changed the title 🐛 fix(range-datepicker): Prevent inline mode from resetting selection… Fix #6294: 🐛 Fix inline range datepicker resetting selection on handleSelect Jun 25, 2026
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.32%. Comparing base (548a1f3) to head (05ecbbb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6296      +/-   ##
==========================================
+ Coverage   99.29%   99.32%   +0.02%     
==========================================
  Files          30       30              
  Lines        3822     3825       +3     
  Branches     1648     1668      +20     
==========================================
+ Hits         3795     3799       +4     
+ Misses         26       25       -1     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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