From b9c6fc59a6390b04e721180cc3ff9e93be94873e Mon Sep 17 00:00:00 2001 From: Taylor Jones Date: Tue, 6 Dec 2022 07:53:11 -0600 Subject: [PATCH] fix(getInteractiveContent): add null checks --- packages/react/src/internal/useNoInteractiveChildren.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react/src/internal/useNoInteractiveChildren.js b/packages/react/src/internal/useNoInteractiveChildren.js index 46005d99bcfd..cefccdb88401 100644 --- a/packages/react/src/internal/useNoInteractiveChildren.js +++ b/packages/react/src/internal/useNoInteractiveChildren.js @@ -33,6 +33,10 @@ export function useNoInteractiveChildren( * @returns {HTMLElement} */ export function getInteractiveContent(node) { + if (!node || !node.childNodes) { + return null; + } + if (isFocusable(node)) { return node; }