Skip to content

Commit

Permalink
[docs] Add Swipe & Scroll guide (#3254)
Browse files Browse the repository at this point in the history
## Description

At the beginning of new web implementation `Swipeable` component was
blocking `scroll` on `web`. We did fix it by adding `touch-action:
pan-y;` as a property to our handlers, and making it default in `Pan`
used under the hood of `Swipeable`.

However, some of our users prefer to create their own versions of
`Swipeable` - that's where they encounter this issue.

This PR adds guide section about fixing this problem.

It also changes font size of `code` inside headers such that it is no
longer ridiculously small.
## Test plan

Run docs
  • Loading branch information
m-bert authored Dec 2, 2024
1 parent bf55fde commit 39caf79
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/docs/guides/swipe-and-scroll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
id: swipe-and-scroll
title: Custom swipeable components inside ScrollView (web)
---

While we recommend using our own [`ReanimatedSwipeable`](../components/reanimated_swipeable.md) component, creating your own version of swipeable gives you more control over its behavior. Common issue here is that after creating your own swipeable component, scroll does not work. In that case, try adding [`touchAction`](../gestures/gesture-detector.md#touchaction-web-only) set to `"pan-y"`, like this:

```jsx
<GestureDetector gesture={...} ... touchAction="pan-y">
...
</GestureDetector>
```
5 changes: 5 additions & 0 deletions docs/src/css/typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ code {
border-bottom: 1px solid var(--ifm-font-color-base);
}

.markdown h2 code {
font-size: 22px;
font-weight: 600;
}

/* Sidebar */
[class*='menu__list-item-collapsible'] a {
font-family: var(--swm-title-font);
Expand Down

0 comments on commit 39caf79

Please sign in to comment.