-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unable to correct value in day segment on useDateField #4087
Comments
Is there a particular locale required to reproduce this? The docs for me are |
The doc shows Thanks |
Verified this locally with the Canada locale set in our storybook. Most likely something with this onInput is my initial thought, thanks for reporting! |
ah good call, closing! |
🐛 Bug Report
useDateField broke on day segment. When first entered into the yyyy/mm/dd segment and type in 2023 12 31, it works. Now press backspace to delete 31 on the day segment. The dd placeholder should show. (Don't unfocus from the segment.) Enter 2, and 02 is displayed in the day segment. Then type e.g., the digit 5, to finish entering day 25 of the month. Expect 25 to be entered but instead, 05 is shown.
🤔 Expected Behavior
Expect to be able to edit/correct day entered in the day segment. e.g., enter 30, backspace backspace and enter 25. 25 should be the day but it's 05.
😯 Current Behavior
When first entered into the yyyy/mm/dd segment and type in 2023 12 31, it works. Now press backspace to delete 31 on the day segment. The dd placeholder should show. (Don't unfocus from the segment.) Enter 2, and 02 is displayed in the day segment. Then type e.g., the digit 5, to finish entering day 25 of the month. Expect 25 to be entered but instead, 05 is shown.
💁 Possible Solution
the problem is that the day segment as zero leading text in it. A possible solution is not to normalized the text with leading zero until blur out of that segment.
🔦 Context
Use is expecting to be able to backspace to correct typo but it's currently impossible to do that. If user move the focus to another control on the page and click back into the segment, then the user can enter the day again, but this "work-around" is discovered by accident and not how it's expected to behave.
💻 Code Sample
No need for a separate codesandbox. The documentation page of useDateField has a datefield and you can reproduce the problem there. https://react-spectrum.adobe.com/react-aria/useDateField.html#example
🌍 Your Environment
🕷 Tracking Issue (optional)
The text was updated successfully, but these errors were encountered: