Describe the bug
With certain content in Modal, such as NavTabs, our focus lock utility doesn't trap keyboard navigation within the Modal. This is exemplified in our Drawer component which uses Modal and is reproducible when using it as a navigational element.
To Reproduce
Steps to reproduce the behavior:
Go to our documentation site.
Navigate to Components > Drawer
Click "Show Drawer" under "Navigation Example"
Tab through the opened Drawer
Expected behavior
The focus lock should allow the user to tab through the UI while staying within Drawer.
Additional context
It seems that the focusTrapElement variable in Modal.tsx causes the issue. An update made to Modal about a year ago regarding portals also caused animations to break and other oddities. This may have something to do with it in addition.
Describe the bug With certain content in
Modal
, such asNavTabs
, our focus lock utility doesn't trap keyboard navigation within theModal
. This is exemplified in ourDrawer
component which usesModal
and is reproducible when using it as a navigational element.To Reproduce Steps to reproduce the behavior:
Drawer
Drawer
Expected behavior The focus lock should allow the user to tab through the UI while staying within
Drawer
.Additional context It seems that the
focusTrapElement
variable inModal.tsx
causes the issue. An update made toModal
about a year ago regarding portals also caused animations to break and other oddities. This may have something to do with it in addition.