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]: Resetting Datepicker range with calendar using value property doesn't work when assigning either an array of two emtpy strings ["", ""] or an empty string "" #17702

Open
2 tasks done
prmangip opened this issue Oct 9, 2024 · 0 comments · May be fixed by #17889

Comments

@prmangip
Copy link

prmangip commented Oct 9, 2024

Package

@carbon/react

Browser

Chrome, Safari, Firefox

Package version

v1.67.0

React version

v18.2.0

Description

Resetting Datepicker range with calendar using value property doesn't work when assigning either an array of two emtpy strings ["", ""] or an empty string ""

Below are our observations on the issue to summarize,

  1. If we use an empty array [], the end date is not getting reset
  2. If we use empty string "", when manually enter dates instead of picking from calendar opens up the calendar on end date input upon resetting.
  3. We tried using array of two empty strings ["", ""], this fixes the issue with manual input, however, it's causing another issue, which is end date pertaining to previously selected value immediately after selecting the start date without opening calendar.

Reproduction/example

https://stackblitz.com/edit/github-cmfaqv?file=src%2FApp.jsx

Steps to reproduce

  1. Select date range using calendar
  2. Click on "Reset range" button
  3. Dates would be reset
  4. Now select "Start date" again through calendar
  5. You observe "End date" would automatically appear from your previous selection even after you reset both dates

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Application/PAL

No response

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ⏱ Backlog
Development

Successfully merging a pull request may close this issue.

2 participants