mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.87k stars 1.9k forks source link

DateInput component with "clearable" does not clear previously selected value in UI after clicking "x" to clear until the field blurs #4481

Closed ipurra closed 1 year ago

ipurra commented 1 year ago

What package has an issue

@mantine/dates

Describe the bug

Using the DateInput field use the following steps to reproduce my issue:

  1. Add a DateInput field with the clearable property set to true to your page (see sandbox for code example)
  2. Navigate to the date input field in the UI
  3. Click in the field, select any date, the picker closes
  4. Click in the field again to open the date picker
  5. When the date picker is open and there is a value in the field click the x button inside the input field to clear the field
  6. Notice that the actual value now is set to null but the previously selected value is still visible in the input field until the field is blurred

What version of @mantine/hooks page do you have in package.json?

6.0.15 (sandbox 6.0.8, same issue)

If possible, please include a link to a codesandbox with the reproduced problem

https://codesandbox.io/s/reverent-night-y87t8x?file=/src/App.tsx

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

None

Possible fix

No response

mrbnclt commented 1 year ago

I'd like to work on the fix for this issue