Closed efstathiosntonas closed 1 year ago
Hi @efstathiosntonas
It might be a react native issue as it's fetched from RN API.
import { NativeModules, Platform } from 'react-native';
// based on: https://github.com/callstack/react-native-paper/blob/main/src/constants.tsx
const statusBarHeight =
NativeModules.NativeUnimoduleProxy?.modulesConstants?.ExponentConstants?.statusBarHeight ?? 0;
export const APPROX_STATUSBAR_HEIGHT: number = Platform.select({
android: statusBarHeight,
ios: Platform.Version < 11 ? statusBarHeight : 0,
});
Have you tried to find out other proper calculations of the height of the status bar on Android? Also, could you provide a repo with a reproduction of this issue?
May I ask why this is needed? Is it needed for the Portal
to properly calculate it's position?
I'll fork one of the expo examples and try to reproduce it.
You could get the status bar height for android from https://reactnative.dev/docs/statusbar#currentheight-android or use an external dep like https://github.com/ovr/react-native-status-bar-height
Hey @efstathiosntonas can you check on the real android device ? I remember that on emulators there are some strange problems regarding to calculations of height: https://github.com/callstack/react-native-paper/issues/3568. As you can see some people have them and some have not
@kkaplinski I’ve tried on a Samsung S22 and on a Pixel 6 emulator and the gap was there on both. I’m trying to reproduce it on an Expo snack (from docs) but I couldn’t, will try and create one locally and share it.
HI @efstathiosntonas
@ookil has fixed it in the latest release: https://github.com/MobileReality/react-native-select-pro/releases/tag/%40mobile-reality%2Freact-native-select-pro%402.1.6
APPROX_STATUSBAR_HEIGHT
seems to provide wrongtop
position of the options list container on Android. On iOS it works fine since it's always0
on versions > 11.https://github.com/MobileReality/react-native-select-pro/blob/6a9ac023cf0bbb25027f466503a9a05cec003dd3/packages/react-native-select-pro/src/components/select/select.hooks.ts#L82
With
APPROX_STATUSBAR_HEIGHT
:Without
APPROX_STATUSBAR_HEIGHT
:Environment: