about summary refs log tree commit diff
path: root/src/view/com/util/List.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-04-28 17:48:20 +0100
committerGitHub <noreply@github.com>2024-04-28 17:48:20 +0100
commit1dd3d6657c631905c27fa6af326d31a0f7c6039e (patch)
tree01b5e2997e2fd7172a8f6ee11ca525f114593541 /src/view/com/util/List.tsx
parent3b4848ba59591b58a95c61af210697149a858f57 (diff)
downloadvoidsky-1dd3d6657c631905c27fa6af326d31a0f7c6039e.tar.zst
Account for momentum when hiding minimal shell (#3740)
* Add optional momentum events to scroll context

* If there is a velocity, don't snap until momentum end

* Don't show bar on scroll down

* Rm onMomentumBegin
Diffstat (limited to 'src/view/com/util/List.tsx')
-rw-r--r--src/view/com/util/List.tsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/view/com/util/List.tsx b/src/view/com/util/List.tsx
index 5729a43a5..d96a634ef 100644
--- a/src/view/com/util/List.tsx
+++ b/src/view/com/util/List.tsx
@@ -64,6 +64,11 @@ function ListImpl<ItemT>(
         }
       }
     },
+    // Note: adding onMomentumBegin here makes simulator scroll
+    // lag on Android. So either don't add it, or figure out why.
+    onMomentumEnd(e, ctx) {
+      contextScrollHandlers.onMomentumEnd?.(e, ctx)
+    },
   })
 
   let refreshControl