Skip to content

Commit

Permalink
Merge pull request #425 from Refinitiv/fix/overlay-tab
Browse files Browse the repository at this point in the history
fix(overlay): Tab does not work with slotted elements
  • Loading branch information
goremikins authored Aug 9, 2022
2 parents 6f16e18 + 16f4b60 commit a6c2479
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/elements/src/overlay/managers/focus-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ export class FocusManager {

private isFocusBoundaryDescendant (element: HTMLElement): boolean {
const focusBoundaryElements = this.focusBoundaryElements;
let node = element.parentNode;
let node = element.assignedSlot || element.parentNode;
while (node) {
if ((node instanceof HTMLElement || node instanceof ShadowRoot) && focusBoundaryElements.includes(node)) {
return true;
}
// parenNode is not defined if the node is inside document fragment. Use host instead
node = node.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? (node as ShadowRoot).host : node.parentNode;
node = node.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? (node as ShadowRoot).host : ((node as Element).assignedSlot || node.parentNode);
}

return false;
Expand Down

0 comments on commit a6c2479

Please sign in to comment.