fix(modal): sheet modal now allows input focusing when backdrop disabled (#24840)

resolves #24581
This commit is contained in:
Liam DeBeasi
2022-02-28 13:27:12 -05:00
committed by GitHub
parent 9e0917597c
commit e4ec572043
9 changed files with 134 additions and 13 deletions

View File

@ -128,6 +128,17 @@ const trapKeyboardFocus = (ev: Event, doc: Document) => {
*/
if (!lastOverlay || !target) { return; }
/**
* If the ion-disable-focus-trap class
* is present on an overlay, then this component
* instance has opted out of focus trapping.
* An example of this is when the sheet modal
* has a backdrop that is disabled. The content
* behind the sheet should be focusable until
* the backdrop is enabled.
*/
if (lastOverlay.classList.contains('ion-disable-focus-trap')) { return; }
const trapScopedFocus = () => {
/**
* If we are focusing the overlay, clear