fix(app): separate iOS composer clipping from its shadow

Keep explicit coverage of the existing keyboard rotation guard.

Co-authored-by: Elsa Granger <zeyugao@outlook.com>
This commit is contained in:
Mohamed Boudra
2026-11-04 07:15:43 +01:00
co-authored by Elsa Granger
parent 3e6f91dc7b
commit bfe11d31a6
2 changed files with 23 additions and 2 deletions
+8 -2
View File
@@ -8,6 +8,7 @@ import {
import { LoadingSpinner } from "@/components/ui/loading-spinner";
import {
View,
Platform,
Text,
useWindowDimensions,
NativeSyntheticEvent,
@@ -1930,7 +1931,7 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(
const inputWrapperCombinedStyle = useMemo(
() => [
styles.inputWrapper,
isCompact && !isFullscreen && styles.inputWrapperCompact,
Platform.OS !== "ios" && isCompact && !isFullscreen && styles.inputWrapperCompact,
readOnly && styles.inputWrapperReadOnly,
inputWrapperStyle,
{ opacity: surfacePresentation.input.opacity },
@@ -2224,7 +2225,11 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(
return (
<View
ref={rootRef}
style={isFullscreen ? styles.fullscreenContainer : styles.container}
style={
isFullscreen
? styles.fullscreenContainer
: [styles.container, Platform.OS === "ios" && isCompact && styles.inputWrapperCompact]
}
testID="message-input-root"
onLayout={handleComposerLayout}
>
@@ -2269,6 +2274,7 @@ const styles = StyleSheet.create((theme: Theme) => ({
position: "relative",
},
inputWrapper: {
...(Platform.OS === "ios" ? { overflow: "hidden" as const } : {}),
flexShrink: 1,
flexDirection: "column",
gap: theme.spacing[3],
@@ -53,6 +53,21 @@ describe("resolveStreamKeyboardInset", () => {
});
describe("resolveKeyboardShift", () => {
it.each([0, -1])(
"ignores a rotation report with height %s and progress one",
(rawKeyboardHeight) => {
expect(
resolveKeyboardShift({
rawKeyboardHeight,
keyboardProgress: 1,
bottomInset: 24,
isIos: true,
iosMinHeight: 120,
}),
).toBe(0);
},
);
it("keeps the existing open-keyboard offset behavior", () => {
expect(
resolveKeyboardShift({