Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - onFocusChange in date range picker preset example #4941

Open
AndreasDamen opened this issue Feb 26, 2025 · 5 comments
Open

[BUG] - onFocusChange in date range picker preset example #4941

AndreasDamen opened this issue Feb 26, 2025 · 5 comments
Labels
📋 Scope : Docs Related to the documentation

Comments

@AndreasDamen
Copy link

HeroUI Version

2.7.2

Describe the bug

The datepicker only changes the start date due to:
onFocusChange: (val) => setValue({...value, start: val}),

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. copy poc
  2. test datepicker
  3. notice the end date is not changed

Expected behavior

as a user i expect the end date to change. but the onfocuschange only changes the start date, creating issues.

Screenshots or Videos

No response

Operating System Version

windows 11

Browser

Chrome

Copy link

linear bot commented Feb 26, 2025

@wingkwong
Copy link
Member

Can you please elaborate more? onFocusChange: (val) => setValue({...value, start: val}), looks like a prop from calendar instead. I'm not sure what the issue here is. In the given code, you just update the start date. Every time it should only one date is changed, you can handle the logic there and update end date as well.

@AndreasDamen
Copy link
Author

AndreasDamen commented Feb 27, 2025

in the example on your website: https://www.heroui.com/docs/components/date-range-picker#presets
you can try to set the date range by selecting 2 dates. however, only the first date is changed, on both clicks.

Image

End date is never updated when using the calendar in the code snippet on your site

@wingkwong
Copy link
Member

Oh I got what you mean now. Thanks.

@wingkwong wingkwong added 📋 Scope : Docs Related to the documentation and removed 🔎 Status: More Info Needed labels Feb 27, 2025
@AndreasDamen
Copy link
Author

No worries haha. Thx for picking it up so fast!

@wingkwong wingkwong assigned wingkwong and unassigned wingkwong Feb 27, 2025
@wingkwong wingkwong changed the title [BUG] - Date-range-picker [BUG] - onFocusChange in date range picker preset example Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📋 Scope : Docs Related to the documentation
Projects
None yet
Development

No branches or pull requests

2 participants