Skip to content

Commit

Permalink
fix(getInteractiveContent): add null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
tay1orjones committed Dec 6, 2022
1 parent 3f18780 commit b9c6fc5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react/src/internal/useNoInteractiveChildren.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export function useNoInteractiveChildren(
* @returns {HTMLElement}
*/
export function getInteractiveContent(node) {
if (!node || !node.childNodes) {
return null;
}

if (isFocusable(node)) {
return node;
}
Expand Down

0 comments on commit b9c6fc5

Please sign in to comment.