[useDateRangePicker] how to prevent autofocus on closeButton in dateField? #4677
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
The button that line refers to is the popover button, not the clear button. I'm not sure where that clear button is coming from, we don't have it in any of our examples that I see. You could make the clear button non-tabbable, using tabIndex = -1. But you'll need to provide a keyboard accessible way to also clear the field. Usually 'Escape' is good for this. This is probably the best approach. If that doesn't work, you could try some of these other solutions. You could move the clear button to outside of the field, or, soon, rely on Form 'reset' behavior. If you wanted the clear button to look like it was inside, but be the last tabbable element in the component, you could possibly use CSS 'order', though that may be confusing to users who are sighted as it would appear that focus is jumping around out of order. |
Beta Was this translation helpful? Give feedback.
Sending a PR is the fastest way to get a bug fixed. Otherwise you'll have to tolerate our priorities a bit more.
The idea I shared was:
So that accept function would look more like (psuedo-ish code)