Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
fix(Modal): FocusTrap works with showClose being false #2774
cdcabrera left a comment
So quick question on this solution
The solution here looks similar to what's on the Readme for Focus Trap... https://github.com/davidtheclark/focus-trap-react#readme however there look like a couple of other props that I'm curious to know if we tried as well?
jeff-phillips-18 left a comment
I don't think we want to disable the focus trap just because there is no close button. We want the focus to stay in the modal until closed for those modals that DO have focusable elements. I believe it would be an exception to have a modal w/ no focusable elements.
I would suggest if we want to support modals w/o any focusable elements we add a prop to specify not adding the focus trap.
Your changes have been released in:
Thanks for your contribution!