Skip to content

Commit

Permalink
fix(overlays): only set inert for placementMode global
Browse files Browse the repository at this point in the history
  • Loading branch information
Joren Broekema committed Dec 2, 2020
1 parent 0f41bf2 commit 83359ac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-onions-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lion/overlays': patch
---

Only set inert when placementMode is global, otherwise events are broken inside local overlay content
2 changes: 1 addition & 1 deletion packages/overlays/src/OverlayController.js
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ export class OverlayController extends EventTargetShim {
this._containFocusHandler = containFocus(this.contentNode);
this.__hasActiveTrapsKeyboardFocus = true;
if (this.manager) {
this.manager.informTrapsKeyboardFocusGotEnabled();
this.manager.informTrapsKeyboardFocusGotEnabled(this.placementMode);
}
}

Expand Down
7 changes: 5 additions & 2 deletions packages/overlays/src/OverlaysManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,11 @@ export class OverlaysManager {
});
}

informTrapsKeyboardFocusGotEnabled() {
if (this.siblingsInert === false) {
/**
* @param {'local' | 'global' | undefined} placementMode
*/
informTrapsKeyboardFocusGotEnabled(placementMode) {
if (this.siblingsInert === false && placementMode === 'global') {
if (OverlaysManager.__globalRootNode) {
setSiblingsInert(this.globalRootNode);
}
Expand Down

0 comments on commit 83359ac

Please sign in to comment.