diff --git a/src/helpers.ts b/src/helpers.ts index f72f32e..c008d6e 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -70,6 +70,9 @@ export const isVertical = (direction: DrawerDirection) => { }; export function getTranslate(element: HTMLElement, direction: DrawerDirection): number | null { + if (!element) { + return null; + } const style = window.getComputedStyle(element); const transform = // @ts-ignore