Open jenmak-tangelo opened 1 year ago
I see that. Looks like it is caused by https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/datepicker/src/useDatePickerGroup.ts#L97 Which will focus the first placeholder in the group. I've checked against the example, if I fill in the first segment and then repeat your steps, then the first placeholder is indeed focused.
I'm not sure this is a bug, if you were on the last segment of an empty field and pressed Enter, would it just stay on that last segment? It seems more useful for it to go to the first, that way a user can fill in each segment and the field will auto advance as the user types.
I think that makes sense for when all fields are empty. But, the issue we are having in production is that when all of the fields are filled in and you press Enter, instead of taking you to the next focusable element outside of the date field, it takes you to the second to last segment. (We want there to be consistency between the DatePicker and the TextField which currently has this Enter behavior.)
I think that makes sense for when all fields are empty. But, the issue we are having in production is that when all of the fields are filled in and you press Enter, instead of taking you to the next focusable element outside of the date field, it takes you to the second to last segment. (We want there to be consistency between the DatePicker and the TextField which currently has this Enter behavior.)
That's precisely what I'm facing in prod. In my case, I have only a date field in the form once I filled all segments and pressed Enter I'm expecting to submit the form instead of backing a segment.
Is there any workarounds to this issue?
No workarounds short of modifying the press handler that @snowystinger shared via something like patch-package that I can think of.
We would also accept a PR if you wanted to address this. See our contributing guide https://react-spectrum.adobe.com/contribute.html
Is there an update on this?
so unfortunate to see this bug still exists ๐, I'm also having an issue w/ this
Provide a general summary of the issue here
When the user hits Enter, the date picker focus moves from the last to the first date segment.
๐ค Expected Behavior?
The user should be able to hit enter and traverse through the segments and through to the next field.
๐ฏ Current Behavior
The date picker focus moves from the last to the first date segment and you cannot get to the next field by hitting Enter in a form.
๐ Possible Solution
Add logic for the enter key to move focus through the segments.
๐ฆ Context
No response
๐ฅ๏ธ Steps to Reproduce
Go to the example: https://react-spectrum.adobe.com/react-aria/useDatePicker.html Click on
mm
and hit Enter. See that it does nothing. Tab to the year segment and hit Enter. See that it goes backward to the beginning.Version
3.26.0
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
Mac OS
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response