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

Clearing the date picker input field does not clear the value #2173

Closed
1 of 3 tasks
MartinSchmidt123 opened this issue Jan 13, 2025 · 1 comment
Closed
1 of 3 tasks

Comments

@MartinSchmidt123
Copy link

Description

I use the example date picker code from https://ark-ui.com/react/docs/components/date-picker#examples .

The date picker value can be modified by a user via input field or trigger button.
The problem arises when trying to clear the value via clearing the input field.
Removing the date from the input field does not reset the date picker value.

Link to Reproduction (or Detailed Explanation)

https://codesandbox.io/p/devbox/ark-date-input-k6d8vt

Steps to Reproduce

  1. Open the provided codesandbox (e.g. https://k6d8vt-5174.csb.app/)

  2. select an arbitrary date (via entering 1/1/2001 or using the trigger button and clicking on 1/1/2001 does not matter)

  3. click on the trigger button to open the calendar view
    image

  4. click in the input field

  5. remove all characters in the input field

  6. press tab to move the cursor out of the input field
    image

Error 1: The input field is empty, but the date picker value is still 1/1/2001
Error 2: Clicking on 1/1/2001 in the calendar view does not fill it into the input field.

Ark UI Version

4.8.0

Framework

  • React
  • Solid
  • Vue

Browser

Firefox

Additional Information

The problem is also reproducible on the example provided at
https://ark-ui.com/react/docs/components/date-picker

@segunadebayo segunadebayo transferred this issue from chakra-ui/ark Jan 14, 2025
@segunadebayo
Copy link
Member

segunadebayo commented Jan 15, 2025

Good catch @MartinSchmidt123

I just pushed a fix for this. We'll release an update shortly.

I also have a test for it here: https://github.com/chakra-ui/zag/blob/main/e2e/date-picker.e2e.ts#L100

If the issue persists after upgrading, I'll re-open it.

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

No branches or pull requests

2 participants