You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This screenshot shows document.activeElement pointing to a sentinel (a <FocusRedirector> created by the <FocusTrap>).
Version
4.15.1
Describe the bug
After the message content no longer contains any tabbable elements (say, card is disabled after submission), pressing TAB key should send the focus back to the chat history.
Use keyboard navigation keys to click on the "United States" button
After the result is submitted, press TAB key and observe the focus ring is gone
Expected behavior
As both "United States" and "Hong Kong" button is disabled, pressing TAB key should send the focus back to the chat history.
Additional context
When the button is disabled, we must not send the focus elsewhere or blur. This is for accessibility reasons. Say, when a button is disabled, the focus should stay on the button until the user moved it away.
When disabling a button, currently, we are leaving the button enabled until the focus is moved away. Then, we set the button as disabled. We could do it better by setting the tabindex on the button as -1. Then, we will not need to observe the blur event on the button. We just need to leave the tabindex="-1" on the element.
[Bug]
The text was updated successfully, but these errors were encountered:
Screenshots
This screenshot shows
document.activeElement
pointing to a sentinel (a<FocusRedirector>
created by the<FocusTrap>
).Version
4.15.1
Describe the bug
After the message content no longer contains any tabbable elements (say, card is disabled after submission), pressing TAB key should send the focus back to the chat history.
Steps to reproduce
Expected behavior
As both "United States" and "Hong Kong" button is disabled, pressing TAB key should send the focus back to the chat history.
Additional context
When the button is disabled, we must not send the focus elsewhere or blur. This is for accessibility reasons. Say, when a button is disabled, the focus should stay on the button until the user moved it away.
When disabling a button, currently, we are leaving the button enabled until the focus is moved away. Then, we set the button as disabled. We could do it better by setting the
tabindex
on the button as-1
. Then, we will not need to observe theblur
event on the button. We just need to leave thetabindex="-1"
on the element.[Bug]
The text was updated successfully, but these errors were encountered: