-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose focus-trap configuration #295
Conversation
This is an extension to #178 released with 0.2.1 and enables more fine grained control over the focus-trap, which might be necessary to work around issues with clickOutsideDeactivates vs allowOutsideClick described in [the projects README](https://github.com/focus-trap/focus-trap#createfocustrapelement-createoptions) It also documents that configuration option in the projects README.
5d4b127
to
a1bdc87
Compare
the problem with this is that we are adding the focus-trap API to our own public API and any breaking change to the focus-trap API means that we also have to make a breaking API change. I would prefer to solve the use cases where focus-trap option changes are necessary by abstracting these option in our own API in some way instead of directly exposing the library. The fact that we're using focus-trap IMHO should be seen as an implementation detail. |
Works for me, I'll make a new PR exposing some of the options and documents these. |
Did this end up going anywhere? I'm in the process of migrating our app's modals implementation over to
|
refs mainmatter#435 refs mainmatter#295 https://github.com/focus-trap/focus-trap is used internally for keeping focus inside a modal and for clicks outside to close the modal. It's `clickOutsideDecactivates` config is exposed allowing for clicks on wormholed elements such as dropdowns inside a modal to not close the modal unexpectedly, however without the companion `allowOutsideClick` config those clicks are prevented from performing any interaction. - added `allowOutsideClick` to the options passed through from the `modals` service to the `focus-trap` initialisation
refs mainmatter#435 refs mainmatter#295 https://github.com/focus-trap/focus-trap is used internally for keeping focus inside a modal and for clicks outside to close the modal. It's `clickOutsideDecactivates` config is exposed allowing for clicks on wormholed elements such as dropdowns inside a modal to not close the modal unexpectedly, however without the companion `allowOutsideClick` config those clicks are prevented from performing any interaction. - added `allowOutsideClick` to the options passed through from the `modals` service to the `focus-trap` initialisation
refs mainmatter#435 refs mainmatter#295 https://github.com/focus-trap/focus-trap is used internally for keeping focus inside a modal and for handling modal closing on certain events. If the consuming app wants to manage deactivation/close-inducing events itself then it needs some way to pass `focus-trap` config through to turn off that functionality. - added `escapeDeactivates` to the options passed through from the `modals` service to the `focus-trap` initialisation
This is an extension to #178 released with 0.2.1 and enables more fine grained control over the focus-trap, which might be necessary to work around issues with clickOutsideDeactivates vs allowOutsideClick described in the projects README.