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

Input isn't updated when open={false} and click outside #5274

Open
jorgvm opened this issue Dec 10, 2024 · 1 comment
Open

Input isn't updated when open={false} and click outside #5274

jorgvm opened this issue Dec 10, 2024 · 1 comment

Comments

@jorgvm
Copy link

jorgvm commented Dec 10, 2024

Describe the bug
I use the library as a date field, never showing the popper, by using open={false}.
When you click outside the input, an incorrect value (like "02/31/2000") isn't fixed (but when you use tab it is).

To Reproduce
<DatePicker
selected={value}
onChange={setValue}
open={false} // problem is caused by this setting
/>

  1. Enter "02/31/2000" then press tab (this works, the input date is fixed)
  2. Enter "02/31/2000" then click outside input (this doesn't work, notice how the input isn't updated)

Codesandbox example.

Expected behavior
When I click outside the input, I expect the value to be fixed. Just like what happens when you press tab.

Desktop :

  • OS: Mac Os 15
  • Browser: Chrome
  • Version: 131

** Additional **
When you dont' use "open={false}", it works as expected.

@balajis-qb
Copy link
Contributor

Understood, I'll work on 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