diff --git a/src/components/Menu/Menu.tsx b/src/components/Menu/Menu.tsx index edf19de4eb..0e241a2c01 100644 --- a/src/components/Menu/Menu.tsx +++ b/src/components/Menu/Menu.tsx @@ -4,7 +4,6 @@ import { Dimensions, Easing, EmitterSubscription, - findNodeHandle, I18nManager, Keyboard, KeyboardEvent as RNKeyboardEvent, @@ -117,13 +116,12 @@ const focusFirstDOMNode = (el: View | null | undefined) => { // When in the browser, we want to focus the first focusable item on toggle // For example, when menu is shown, focus the first item in the menu // And when menu is dismissed, send focus back to the button to resume tabbing - const node: any = findNodeHandle(el); - const focusableNode = node.querySelector( - // This is a rough list of selectors that can be focused - 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])' - ); - - focusableNode?.focus(); + if (el instanceof HTMLElement) { + el.querySelector( + // This is a rough list of selectors that can be focused + 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])' + )?.focus(); + } } };