Skip to content

Commit 6318bfc

Browse files
fix(mobile): new-thread heading clears the iPad header (#23206)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent f8e4834 commit 6318bfc

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎apps/mobile/src/features/threads/NewTaskDraftScreen.tsx‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import {
2121
usePreventRemove,
2222
type NavigationAction,
2323
} from "@react-navigation/native";
24-
import { useEffect, useEffectEvent, useLayoutEffect, useRef, useState } from "react";
24+
import { HeaderHeightContext } from "@react-navigation/elements";
25+
import { useContext, useEffect, useEffectEvent, useLayoutEffect, useRef, useState } from "react";
2526
import { Platform, Pressable, ScrollView, View } from "react-native";
2627
import {
2728
KeyboardController,
@@ -214,6 +215,9 @@ export function NewTaskDraftScreen(props: {
214215
reserveShare,
215216
} = useIncomingShare();
216217
const insets = useSafeAreaInsets();
218+
// The iOS glass header floats over the hero, and its height differs between an
219+
// iPhone sheet and an iPad column that also carries the status bar.
220+
const navigationHeaderHeight = useContext(HeaderHeightContext) ?? insets.top + 56;
217221
const isKeyboardVisible = useKeyboardState((state) => state.isVisible);
218222
const controlsBottomPadding = Math.max(insets.bottom, 10);
219223
const keyboardOpenedOffset = Math.max(0, controlsBottomPadding - 8);
@@ -1550,7 +1554,10 @@ export function NewTaskDraftScreen(props: {
15501554
alwaysBounceVertical={isKeyboardVisible}
15511555
className="flex-1"
15521556
contentInsetAdjustmentBehavior="never"
1553-
contentContainerClassName="grow items-center pb-[236px] pt-12 ios:pt-[72px]"
1557+
contentContainerClassName="grow items-center pb-[236px] pt-12"
1558+
contentContainerStyle={
1559+
Platform.OS === "ios" ? { paddingTop: navigationHeaderHeight + 16 } : undefined
1560+
}
15541561
keyboardDismissMode={Platform.OS === "ios" ? "interactive" : "on-drag"}
15551562
keyboardShouldPersistTaps="handled"
15561563
showsVerticalScrollIndicator={false}

0 commit comments

Comments
 (0)