Skip to content

Commit cba84fe

Browse files
docs: fix broken heading anchors (#4586)
## Description Six in-page links in the current docs point at heading ids that don't exist, so clicking them doesn't scroll anywhere. The platform badge in headings like `### rippleColor [A]` isn't part of the generated id. The rendered ids are just `ripplecolor`, `averagetouches`, `effect` and `mousebutton`, so links written as `#ripplecolor-android-only` and similar don't match. - `components/buttons`: `#ripplecolor-android-only` → `#ripplecolor` - `components/reanimated-drawer-layout`: `#mousebutton-web--android-only` → `#mousebutton` - `components/reanimated_swipeable`: `#methods` (x2) → `#swipeable-ref-methods` - `gestures/use-hover-gesture`: `#effect-ios-only` → `#effect` - `gestures/use-pan-gesture`: `#averagetouches-android-only` → `#averagetouches` - `guides/testing`: `#getbygesturetestidtestid` → `#getbygesturetestid` ## Test plan Checked each new anchor against the ids on the deployed pages at docs.swmansion.com/react-native-gesture-handler/docs. Versioned 1.x/2.x docs left untouched. Co-authored-by: Michał Bert <63123542+m-bert@users.noreply.github.com>
1 parent 4727219 commit cba84fe

6 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎packages/docs-gesture-handler/docs/components/buttons.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Below we list some of the common usecases for button components to be used along
203203

204204
### Lists and action buttons
205205

206-
If you have a list with clickable items or have an action button that needs to display as a separate UI block (vs being inlined in a text) you should use [`RectButton`](#rectbutton). It changes opacity on click and additionally supports a [ripple effect](#ripplecolor-android-only) on Android.
206+
If you have a list with clickable items or have an action button that needs to display as a separate UI block (vs being inlined in a text) you should use [`RectButton`](#rectbutton). It changes opacity on click and additionally supports a [ripple effect](#ripplecolor) on Android.
207207

208208
<GifGallery>
209209
<img src={useBaseUrl('gifs/androidsettings.gif')} width="280" />

‎packages/docs-gesture-handler/docs/components/reanimated-drawer-layout.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ Either a component rendered in the content view or a function. If `children` is
257257
enableContextMenu: boolean;
258258
```
259259

260-
Specifies whether the context menu should be enabled after clicking on the underlying view with the right mouse button. Default value is set to `false` if [`MouseButton.RIGHT`](#mousebutton-web--android-only) is specified.
260+
Specifies whether the context menu should be enabled after clicking on the underlying view with the right mouse button. Default value is set to `false` if [`MouseButton.RIGHT`](#mousebutton) is specified.
261261

262262
<Badges platforms={['web']}>
263263
### userSelect [W]

‎packages/docs-gesture-handler/docs/components/reanimated_swipeable.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ A function that returns a component which will be rendered beneath the `Swipeabl
175175
- It equals `0` when the `Swipeable` is fully closed and `1` when it is fully opened.
176176
- As the element overshoots its open position, the value approaches `Infinity`.
177177
- `translation` - a horizontal offset of the `Swipeable` relative to its closed position.
178-
- `swipeableMethods` - provides an object exposing methods detailed in the [methods section](#methods).
178+
- `swipeableMethods` - provides an object exposing methods detailed in the [methods section](#swipeable-ref-methods).
179179

180180
This function must return a [`ReactNode`](https://reactnative.dev/docs/react-node). To accommodate `rtl` (right-to-left) flexbox layouts, use the [`flexDirection`](https://reactnative.dev/docs/flexbox#flex-direction) style property.
181181

@@ -195,7 +195,7 @@ A function that returns a component which will be rendered beneath the `Swipeabl
195195
- It equals `0` when the `Swipeable` is fully closed and `1` when it is fully opened.
196196
- As the element overshoots its open position, the value approaches `Infinity`.
197197
- `translation` - a horizontal offset of the `Swipeable` relative to its closed position.
198-
- `swipeableMethods` - provides an object exposing methods detailed in the [methods section](#methods).
198+
- `swipeableMethods` - provides an object exposing methods detailed in the [methods section](#swipeable-ref-methods).
199199

200200
This function must return a [`ReactNode`](https://reactnative.dev/docs/react-node). To accommodate `rtl` (right-to-left) flexbox layouts, use the [`flexDirection`](https://reactnative.dev/docs/flexbox#flex-direction) style property.
201201

‎packages/docs-gesture-handler/docs/gestures/use-hover-gesture.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import SharedValueInfo from './\_shared/shared-value-info.md';
2828

2929
The hover effect may be activated by moving a mouse or a stylus over the view.
3030

31-
On iOS additional [visual effects](#effect-ios-only) may be configured.
31+
On iOS additional [visual effects](#effect) may be configured.
3232

3333
:::note
3434
Don't rely on `Hover` gesture to continue after the mouse button is clicked or the stylus touches the screen. If you want to handle both cases, [compose](/docs/composition/overview) it with [`Pan`](/docs/gestures/use-pan-gesture) gesture.

‎packages/docs-gesture-handler/docs/gestures/use-pan-gesture.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ This applies also to many platform native components that handle touch even if n
108108

109109
On Android, the default behavior for native components like scroll view, pager views or drawers is different and hence gesture defaults to that when it comes to pan handling.
110110
The difference is that instead of treating the center of mass of all the fingers placed as a leading pointer it takes the latest placed finger as such.
111-
This behavior can be changed on Android using [`averageTouches`](#averagetouches-android-only) flag.
111+
This behavior can be changed on Android using [`averageTouches`](#averagetouches) flag.
112112

113113
Note that on both Android and iOS when the additional finger is placed on the screen that translation prop is not affected even though the position of the pointer being tracked might have changed.
114114
Therefore it is safe to rely on translation most of the time as it only reflects the movement that happens regardless of how many fingers are placed on the screen and if that number changes over time.

‎packages/docs-gesture-handler/docs/guides/testing.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ fireGestureHandler: (componentOrGesture, eventList) => void;
187187
Simulates one event stream (i.e. event sequence starting with `BEGIN` state and ending
188188
with one of `END`/`FAIL`/`CANCEL` states), calling appropriate callbacks associated with given gesture handler.
189189

190-
- `componentOrGesture` - Either Gesture Handler component found by `Jest` queries (e.g. `getByTestId`) or Gesture found by [`getByGestureTestId()`](#getbygesturetestidtestid)
190+
- `componentOrGesture` - Either Gesture Handler component found by `Jest` queries (e.g. `getByTestId`) or Gesture found by [`getByGestureTestId()`](#getbygesturetestid)
191191

192192
- `eventList` - Event data passed to appropriate callback. RNGH fills event list if required
193193
data is missing using these rules:

0 commit comments

Comments
 (0)