about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-09-07 09:32:14 -0700
committerGitHub <noreply@github.com>2023-09-07 09:32:14 -0700
commit2963fb4c6dec398a0c39c35e717e175de986622f (patch)
treee9c24733fd00fd75a40d2bd24eaf58efddd14a46 /src
parent138e6d9b9769e33cfe75f9c8dd697d65e7037fb2 (diff)
downloadvoidsky-2963fb4c6dec398a0c39c35e717e175de986622f.tar.zst
Fix scrollbar gutters on web (#1401)
* Fix scrollbar gutters on web

* Fix typecheck
Diffstat (limited to 'src')
-rw-r--r--src/view/com/pager/FeedsTabBar.web.tsx4
-rw-r--r--src/view/com/util/Views.web.tsx20
2 files changed, 12 insertions, 12 deletions
diff --git a/src/view/com/pager/FeedsTabBar.web.tsx b/src/view/com/pager/FeedsTabBar.web.tsx
index 6e94ab60e..48a6ed3a9 100644
--- a/src/view/com/pager/FeedsTabBar.web.tsx
+++ b/src/view/com/pager/FeedsTabBar.web.tsx
@@ -73,8 +73,4 @@ const styles = StyleSheet.create({
     flexDirection: 'row',
     alignItems: 'center',
   },
-  tabBarAvi: {
-    marginTop: 1,
-    marginRight: 18,
-  },
 })
diff --git a/src/view/com/util/Views.web.tsx b/src/view/com/util/Views.web.tsx
index bbd9ce04a..891d3f2ee 100644
--- a/src/view/com/util/Views.web.tsx
+++ b/src/view/com/util/Views.web.tsx
@@ -70,10 +70,18 @@ export const FlatList = React.forwardRef(function <ItemT>(
   if (desktopFixedHeight) {
     style = addStyle(style, styles.fixedHeight)
     if (!isMobile) {
-      contentContainerStyle = addStyle(
-        contentContainerStyle,
-        styles.stableGutters,
-      )
+      // NOTE
+      // react native web produces *three* wrapping divs
+      // the first two use the `style` prop and the innermost uses the
+      // `contentContainerStyle`. Unfortunately the stable-gutter style
+      // needs to be applied to only the "middle" of these. To hack
+      // around this, we set data-stable-gutters which can then be
+      // styled in our external CSS.
+      // -prf
+      // @ts-ignore web only -prf
+      props.dataSet = props.dataSet || {}
+      // @ts-ignore web only -prf
+      props.dataSet.stableGutters = '1'
     }
   }
   return (
@@ -137,8 +145,4 @@ const styles = StyleSheet.create({
     // @ts-ignore web only
     height: '100vh',
   },
-  stableGutters: {
-    // @ts-ignore web only -prf
-    scrollbarGutter: 'stable both-edges',
-  },
 })