fix(overlays): only set inert for placementMode global
This commit is contained in:
parent
0f41bf20c2
commit
83359ac2b9
3 changed files with 11 additions and 3 deletions
5
.changeset/cyan-onions-juggle.md
Normal file
5
.changeset/cyan-onions-juggle.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@lion/overlays': patch
|
||||
---
|
||||
|
||||
Only set inert when placementMode is global, otherwise events are broken inside local overlay content
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue