Clipclop tweaks (#3851)

* scroll on input resize

* add back the padding 🙊

* fix timestamps
This commit is contained in:
Hailey 2024-05-03 15:08:59 -07:00 committed by GitHub
parent 876816675e
commit feff55a14a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 13 deletions

View file

@ -168,9 +168,11 @@ export function MessagesList() {
[contentHeight.value, hasInitiallyScrolled, isAtBottom],
)
const onInputFocus = React.useCallback(() => {
flatListRef.current?.scrollToEnd({animated: true})
}, [flatListRef])
const scrollToEnd = React.useCallback(() => {
requestAnimationFrame(() =>
flatListRef.current?.scrollToEnd({animated: true}),
)
}, [])
const {bottom: bottomInset} = useSafeAreaInsets()
const {gtMobile} = useBreakpoints()
@ -200,6 +202,7 @@ export function MessagesList() {
maintainVisibleContentPosition={{
minIndexForVisible: 1,
}}
contentContainerStyle={{paddingHorizontal: 10}}
removeClippedSubviews={false}
onContentSizeChange={onContentSizeChange}
onStartReached={onStartReached}
@ -215,10 +218,7 @@ export function MessagesList() {
/>
</ScrollProvider>
</View>
<MessageInput
onSendMessage={onSendMessage}
onFocus={isWeb ? onInputFocus : undefined}
/>
<MessageInput onSendMessage={onSendMessage} scrollToEnd={scrollToEnd} />
</KeyboardAvoidingView>
)
}