Fix drawer focus trap making login form unclickable on mobile

Adding `clickOutsideDeactivates` seems to fix the issue, contrary to what the focus-trap documentation implies about it being unnecessary.
This commit is contained in:
Alexander Skvortsov 2021-12-26 22:45:58 -05:00
parent 0c95d28e94
commit d89031f057
No known key found for this signature in database
GPG Key ID: C4E3BBF9C3412B4C

View File

@ -27,7 +27,10 @@ export default class Drawer {
}); });
this.appElement = document.getElementById('app'); this.appElement = document.getElementById('app');
this.focusTrap = createFocusTrap('#drawer', { allowOutsideClick: true }); // Despite the `focus-trap` documentation, both `clickOutsideDeactivates`
// and `allowOutsideClick` are necessary so that inputs in modals triggered
// from the drawer's nav components can be interacted with.
this.focusTrap = createFocusTrap('#drawer', { allowOutsideClick: true, clickOutsideDeactivates: true });
this.drawerAvailableMediaQuery = window.matchMedia( this.drawerAvailableMediaQuery = window.matchMedia(
`(max-width: ${getComputedStyle(document.documentElement).getPropertyValue('--screen-phone-max')})` `(max-width: ${getComputedStyle(document.documentElement).getPropertyValue('--screen-phone-max')})`
); );