Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): reserve the bottom safe area on Android surfaces #6003

ClosedPollyGlot(GitHub profile, opens in a new tab)wants to merge 6 commits intomain fromrefs/pull/6003/headopened View on GitHub

Showing 9 changed files with 21 additions and 4 deletions (loading 6).

x
0 of 9 viewed, 9 left
8 additions and 2 deletionsapps/mobile/src/components/AndroidAnchoredMenu.tsxModified
View file
@@ -6,6 +6,7 @@
import { BackHandler, Pressable, ScrollView, View } from "react-native";
import { useKeyboardState } from "react-native-keyboard-controller";
import Animated, { FadeIn } from "react-native-reanimated";
+import { useSafeAreaInsets } from "react-native-safe-area-context";
​
import { appBlurTargetRef } from "../lib/appBlurTarget";
import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
@@ -81,6 +82,7 @@
​
const { themeAppearance } = useAppearancePreferences();
const isDarkMode = themeAppearance === "dark";
+ const insets = useSafeAreaInsets();
const keyboardVisible = useKeyboardState((state) => state.isVisible);
const keyboardHeight = useKeyboardState((state) => state.height);
const close = useCallback(() => {
@@ -158,9 +160,13 @@
// The keyboard stays up while the menu is open (in-window overlay, no
// focus change), so the space it covers is not usable — without this the
- // composer-pill menus "open down" into the IME and can't be tapped.
+ // composer-pill menus "open down" into the IME and can't be tapped. The
+ // portal host spans the whole window, so the gesture bar is unusable too;
+ // the keyboard already covers it when up, hence the max rather than a sum.
const usableBottom =
- overlay === null ? 0 : overlay.height - (keyboardVisible ? keyboardHeight : 0);
+ overlay === null
+ ? 0