Improve withConstrainedTabbing to take into account click on the content #10165
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
Splitting this out from #9973
While testing the Modal component, an edge case surfaced which should be taken into account by
withConstrainedTabbing
. To reproduce:Testing the modal, it was pointed out that adding a
tabIndex="-1"
to the modal wrapper could help. It does help but if still fails on Safari, Edge, and IE11. Instead of relying on browsers implementation of focus and tab starting point, a better option would trying to address this issue programmatically.Proposed solution
tabIndex="-1"
to thewithConstrainedTabbing
wrapper instead of to the single component wrapped inwithConstrainedTabbing
keydown
event target is the wrapper itself, which happens when clicking in the content and then pressing the Tab keyThe text was updated successfully, but these errors were encountered: