Skip to content

Commit

Permalink
fix: Check for classList existence before use (#540)
Browse files Browse the repository at this point in the history
Closes #537
  • Loading branch information
Regaddi committed Feb 5, 2020
1 parent 8366f6e commit 92a5fa1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/reakit/src/Dialog/__utils/useFocusTrap.ts
Expand Up @@ -24,7 +24,7 @@ function hasNestedOpenModals(
const focusTrapClassName = "__reakit-focus-trap";

export function isFocusTrap(element: Element) {
return element.classList.contains(focusTrapClassName);
return element.classList?.contains(focusTrapClassName);
}

export function useFocusTrap(
Expand Down

0 comments on commit 92a5fa1

Please sign in to comment.