Skip to content

Commit

Permalink
remove unnecessary optional chaining and equality check
Browse files Browse the repository at this point in the history
  • Loading branch information
csorfab committed Sep 23, 2023
1 parent c888ad6 commit e634b41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SideEffect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ export function RemoveScrollSideCar(props: IRemoveScrollEffectProps) {

function getOutermostShadowParent(node: Node | null): HTMLElement | null {
let shadowParent: HTMLElement | null = null;
while (node !== window.document && node !== null) {
while (node !== null) {
if (node instanceof ShadowRoot) {
shadowParent = node.host as HTMLElement;
node = node.host;
}
node = node?.parentNode;
node = node.parentNode;
}
return shadowParent
}

0 comments on commit e634b41

Please sign in to comment.