@@ -493,16 +493,13 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
493493 const [ anchorMessageId , setAnchorMessageId ] = useState < MessageId | null > ( null ) ;
494494 const [ submittedMessageId , setSubmittedMessageId ] = useState < MessageId | null > ( null ) ;
495495 const [ endFollowEnabled , setEndFollowEnabled ] = useState ( true ) ;
496- // Android keys the safe-area padding on keyboard visibility (#5988): the back gesture closes
497- // the keyboard while the editor stays focused, and a focus-keyed inset would leave the toolbar
498- // under the gesture bar. iOS must NOT use visibility — it only flips on keyboardDidHide, after
499- // the hide animation, so the composer would ride down flush to the screen edge and then snap up
500- // into the inset.
501- const composerBottomInset = (
502- Platform . OS === "android" ? isKeyboardVisible : composerExpanded || composerFocused
503- )
504- ? 0
505- : Math . max ( insets . bottom , 12 ) ;
496+ // Android Back hides the keyboard without blurring. Keep its safe-area padding
497+ // fixed through the animation and cancel it with matching composer/list offsets.
498+ const composerBottomInset =
499+ Platform . OS === "ios" && ( composerExpanded || composerFocused )
500+ ? 0
501+ : Math . max ( insets . bottom , 12 ) ;
502+ const composerKeyboardOffset = Platform . OS === "android" ? composerBottomInset : 0 ;
506503 const contentPresentationKind = props . contentPresentation . kind ;
507504 const realThreadSyncLabel = ( ( ) => {
508505 switch ( props . threadSyncStatus ) {
@@ -1145,6 +1142,7 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
11451142 anchorMessageId = { anchorMessageId }
11461143 submittedMessageId = { submittedMessageId }
11471144 contentInsetEndAdjustment = { combinedContentInsetEndAdjustment }
1145+ keyboardOffset = { composerKeyboardOffset }
11481146 contentTopInset = { 0 }
11491147 contentBottomInset = {
11501148 estimatedOverlayHeight +
@@ -1180,12 +1178,11 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
11801178
11811179 { showContent ? (
11821180 < KeyboardStickyView
1183- // iOS emits a native animated height target on both will-show and
1184- // will-hide, so stay subscribed for the full transition.
1185- enabled = { Platform . OS === "ios" || ( isKeyboardVisible && ! keyboardStateSuspect ) }
1181+ // Waiting for a visibility render misses the first keyboard frames.
1182+ enabled = { Platform . OS === "ios" || ! keyboardStateSuspect }
11861183 pointerEvents = "box-none"
11871184 style = { { position : "absolute" , bottom : 0 , left : 0 , right : 0 , top : 0 } }
1188- offset = { { closed : 0 , opened : 0 } }
1185+ offset = { { closed : 0 , opened : composerKeyboardOffset } }
11891186 >
11901187 < ComposerPopoverHost hidden = { composerSlotHidden } popoverHeight = { composerPopoverHeight } >
11911188 { /* The fixed sticky host gives this bottom-anchored child a stable
0 commit comments