Skip to content

fix(components): support opt-in resetOnSelect for calendar range mode#11178

Open
saadpocalypse wants to merge 1 commit into
shadcn-ui:mainfrom
saadpocalypse:fix/calendar-range-reset-on-select
Open

fix(components): support opt-in resetOnSelect for calendar range mode#11178
saadpocalypse wants to merge 1 commit into
shadcn-ui:mainfrom
saadpocalypse:fix/calendar-range-reset-on-select

Conversation

@saadpocalypse

Copy link
Copy Markdown

Summary

Adds support for restarting range selection after a completed range in the Calendar component. When resetOnSelect is passed, the next click clears the previous range and sets the clicked date as the new start date. Default range selection behavior is unchanged when the prop is omitted.

Relates to

Fixes #11159

Changes

  • Dependency:
    • Upgraded react-day-picker to ^9.14.0 in apps/v4/package.json to support the native resetOnSelect prop.
  • Documentation:
    • Documented resetOnSelect in apps/v4/content/docs/components/base/calendar.mdx and apps/v4/content/docs/components/radix/calendar.mdx.
  • Examples:
    • Updated calendar-range demos in apps/v4/examples/base/calendar-range.tsx and apps/v4/examples/radix/calendar-range.tsx to use resetOnSelect.

Test plan

  • Open the Range Calendar demo at /docs/components/base/calendar#range-calendar
  • Click a start date, then an end date, range is selected correctly
  • Click a new date, previous range clears and the clicked date becomes the new start date
  • Confirm default behavior is preserved when resetOnSelect is not passed

Upgrade react-day-picker to ^9.14.0 and document the resetOnSelect prop
so users can restart range selection after a completed range without
changing the default range picker behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@saadpocalypse is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​react-day-picker@​9.14.01001009989100

View full report

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.

[bug]: Calendar Range/Multiselect: Third click doesn't properly reset start date in range selection

1 participant