[GIFs] Reset scroll on query change (#3642)

* scroll list to top on query change

* dismiss keyboard on swipe list

* don't need an effect
This commit is contained in:
Samuel Newman 2024-04-22 22:18:39 +01:00 committed by GitHub
parent 0b3cc59019
commit f49d73dd00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 11 deletions

View file

@ -197,11 +197,10 @@ export function Inner({
export const ScrollableInner = Inner
export function InnerFlatList({
label,
style,
...props
}: FlatListProps<any> & {label: string}) {
export const InnerFlatList = React.forwardRef<
FlatList,
FlatListProps<any> & {label: string}
>(function InnerFlatList({label, style, ...props}, ref) {
const {gtMobile} = useBreakpoints()
return (
<Inner
@ -213,12 +212,13 @@ export function InnerFlatList({
overflow: 'hidden',
}}>
<FlatList
ref={ref}
style={[gtMobile ? a.px_2xl : a.px_xl, flatten(style)]}
{...props}
/>
</Inner>
)
}
})
export function Handle() {
return null