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 5e9f746f37
commit 01e177eb52

View File

@ -27,7 +27,10 @@ export default class Drawer {
});
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(
`(max-width: ${getComputedStyle(document.documentElement).getPropertyValue('--screen-phone-max')})`
);