diff --git a/src/screens/Messages/components/MessageInput.tsx b/src/screens/Messages/components/MessageInput.tsx index 6cde1d4fec..f0b5321245 100644 --- a/src/screens/Messages/components/MessageInput.tsx +++ b/src/screens/Messages/components/MessageInput.tsx @@ -26,7 +26,7 @@ import { } from '#/state/messages/message-drafts' import {type EmojiPickerPosition} from '#/view/com/composer/text-input/web/EmojiPicker' import * as Toast from '#/view/com/util/Toast' -import {android, atoms as a, useTheme} from '#/alf' +import {android, atoms as a, useTheme, web} from '#/alf' import {useSharedInputStyles} from '#/components/forms/TextField' import {PaperPlane_Stroke2_Corner0_Rounded as PaperPlane} from '#/components/icons/PaperPlane' import {useExtractEmbedFromFacets} from './MessageInputEmbed' @@ -132,7 +132,7 @@ export function MessageInput({ })) return ( - + {children} { + if (!isIOS) { + return { + marginBottom: Math.max( + keyboardHeight.get(), + footerHeight + messageInputHeight.get(), + ), + } + } + return {} + }) - const animatedListStyle = useAnimatedStyle(() => ({ - marginBottom: Math.max(keyboardHeight.get(), footerHeight), - })) + const animatedProps: Partial = useAnimatedProps(() => { + if (isIOS) { + return { + scrollIndicatorInsets: { + top: 0, + left: 0, + right: 1, + bottom: + Math.max(keyboardHeight.get(), footerHeight) + + messageInputHeight.get(), + }, + contentInset: { + top: 0, + left: 0, + right: 0, + bottom: + Math.max(keyboardHeight.get(), footerHeight) + + messageInputHeight.get(), + }, + } + } + return {} + }) const animatedStickyViewStyle = useAnimatedStyle(() => ({ transform: [{translateY: -Math.max(keyboardHeight.get(), footerHeight)}], @@ -431,9 +470,7 @@ export function MessagesList({ maxToRenderPerBatch={isWeb ? 32 : 62} keyboardDismissMode="on-drag" keyboardShouldPersistTaps="handled" - maintainVisibleContentPosition={{ - minIndexForVisible: 0, - }} + maintainVisibleContentPosition={{minIndexForVisible: 0}} removeClippedSubviews={false} sideBorders={false} onContentSizeChange={onContentSizeChange} @@ -444,28 +481,52 @@ export function MessagesList({ ListHeaderComponent={ } - contentInset={{bottom: 0}} - contentContainerStyle={{paddingBottom: 0}} - scrollIndicatorInsets={{bottom: 0}} + animatedProps={animatedProps} + automaticallyAdjustKeyboardInsets={false} + automaticallyAdjustContentInsets={false} /> - + + {convoState.status === ConvoStatus.Disabled ? ( ) : blocked ? ( footer ) : ( - - - - - + { + const height = evt.nativeEvent.layout.height + if (height) { + messageInputHeight.set(height) + } + }}> + + + + + + )}