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

DateInput: Sometimes the value changes when editing the form value directly #3818

Closed
neokidev opened this issue Mar 17, 2023 · 2 comments
Closed
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@neokidev
Copy link
Contributor

neokidev commented Mar 17, 2023

What package has an issue

@mantine/dates

Describe the bug

When deleting characters one by one in the DateInput form, the year field will convert to four digits when it reaches two digits in length.

date-input-issue-dropdown-closed.mov

This issue occurs under the following circumstances:

  • When controlling the state (using value and onChange props).
  • When the calendar (dropdown) inside DateInput is not open.

When the calendar is open, you can delete the form values normally as shown in the following video.

date-input-issue-dropdown-opened.mov

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

6.0.0, 6.0.2 (I have checked with these two versions.)

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

https://codesandbox.io/s/mantine-v6-date-input-issue-i8j54d?file=/src/App.tsx

Do you know how to fix the issue

Yes

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

Yes

Possible fix

I have a potential solution (at least, it passes the DateInput test suite). So if this behavior is not expected, I would like to work on a pull request.

@neokidev
Copy link
Contributor Author

@rtivital

Hello, I've created a pull request to address this issue. As this is my first time creating a pull request, I'm a bit concerned that I might have missed something. If you notice any problems, please let me know.
Thank you!

@rtivital rtivital added the TBD It is clear how to fix the issue and the fix will be provided soon label Sep 25, 2023
rtivital added a commit that referenced this issue Nov 12, 2023
…er tries to type in value with closed dropdown (#3818)
@rtivital rtivital added Fixed patch Completed issues that will be published with next patch (1.0.X) and removed TBD It is clear how to fix the issue and the fix will be provided soon labels Nov 12, 2023
@rtivital
Copy link
Member

Fixed in 7.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

2 participants