about summary refs log tree commit diff
path: root/src/components/Dialog/index.web.tsx
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-04-22 22:18:39 +0100
committerGitHub <noreply@github.com>2024-04-22 22:18:39 +0100
commitf49d73dd00462528bd2ff73fd51746756c12fe9d (patch)
tree42e13511a3dc8cbb662f768770438190ff4a249c /src/components/Dialog/index.web.tsx
parent0b3cc5901996e58f8c26566c547a2ea3ea5b6e0b (diff)
downloadvoidsky-f49d73dd00462528bd2ff73fd51746756c12fe9d.tar.zst
[GIFs] Reset scroll on query change (#3642)
* scroll list to top on query change

* dismiss keyboard on swipe list

* don't need an effect
Diffstat (limited to 'src/components/Dialog/index.web.tsx')
-rw-r--r--src/components/Dialog/index.web.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/components/Dialog/index.web.tsx b/src/components/Dialog/index.web.tsx
index a086955db..4cb4e7570 100644
--- a/src/components/Dialog/index.web.tsx
+++ b/src/components/Dialog/index.web.tsx
@@ -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