From e634b418503b1bbd1b6d8d416154c3960be071ea Mon Sep 17 00:00:00 2001 From: csorfab Date: Sat, 23 Sep 2023 22:44:30 +0200 Subject: [PATCH] remove unnecessary optional chaining and equality check --- src/SideEffect.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SideEffect.tsx b/src/SideEffect.tsx index 269dc50..4ba1650 100644 --- a/src/SideEffect.tsx +++ b/src/SideEffect.tsx @@ -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 }