@@ -20,8 +20,9 @@ import {
2020 Pressable ,
2121} from 'react-native' ;
2222
23+ import { useSafeAreaInsets } from 'react-native-safe-area-context' ;
24+
2325import MenuItem from './MenuItem' ;
24- import { APPROX_STATUSBAR_HEIGHT } from '../../constants' ;
2526import { useInternalTheme } from '../../core/theming' ;
2627import type { MD3Elevation , ThemeProp } from '../../types' ;
2728import { ElevationLevels } from '../../types' ;
@@ -182,7 +183,7 @@ const isBrowser = () => Platform.OS === 'web' && 'document' in global;
182183
183184const Menu = ( {
184185 visible,
185- statusBarHeight = APPROX_STATUSBAR_HEIGHT ,
186+ statusBarHeight,
186187 overlayAccessibilityLabel = 'Close menu' ,
187188 testID = 'menu' ,
188189 anchor,
@@ -197,6 +198,7 @@ const Menu = ({
197198 keyboardShouldPersistTaps,
198199} : Props ) => {
199200 const theme = useInternalTheme ( themeOverrides ) ;
201+ const insets = useSafeAreaInsets ( ) ;
200202 const [ rendered , setRendered ] = React . useState ( visible ) ;
201203 const [ left , setLeft ] = React . useState ( 0 ) ;
202204 const [ top , setTop ] = React . useState ( 0 ) ;
@@ -444,7 +446,7 @@ const Menu = ({
444446
445447 // I don't know why but on Android measure function is wrong by 24
446448 const additionalVerticalValue = Platform . select ( {
447- android : statusBarHeight ,
449+ android : statusBarHeight ?? insets . top ,
448450 default : 0 ,
449451 } ) ;
450452
0 commit comments