Skip to content

Commit

Permalink
fix(getInteractiveContent): add null checks (#12789)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
tay1orjones and kodiakhq[bot] authored Dec 6, 2022
1 parent 12f018e commit 5208b5f
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 5208b5f

Please sign in to comment.