You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/docs/grid/examples/touchable.mdx
+20-26Lines changed: 20 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,23 +3,17 @@ sidebar_position: 5
3
3
description: ''
4
4
---
5
5
6
-
# Touchables
6
+
# Touchable
7
7
8
8
## Description
9
9
10
-
This example shows why touchable components exported from this library are useful whe you need to **properly detect press events** on **components nested inside** the sortable component item.
11
-
12
-
:::info
13
-
14
-
The **usage is the same** for **all touchable components exported from this library**. To see more information about other touchable components, please **refer to the [Touchables](/helper-components/touchables) page**.
15
-
16
-
:::
10
+
This example shows why the [Sortable.Touchable](/helper-components/touchable) component is useful when you need to **properly detect press events** on **components nested inside** the sortable component item (more precisely, nested within the part of the item that detects the drag gesture - this might be the entire item or just a part of it if the custom handle, like [Sortable.Handle](/helper-components/handle), is used).
You can see that the `Pressable` component from React Native **still detects the press event even when the item started being dragged**, which is not the desired behavior.
85
79
86
-
On the contrary, the `Sortable.Pressable` component from this library **properly handles the press event** and grid items are removed only when the **Delete** button is **pressed, not when the item is dragged**.
80
+
On the contrary, the `Sortable.Touchable` component from this library **properly handles the press event** and grid items are removed only when the **Delete** button is **pressed, not when the item is dragged**.
Called when the drag gesture ends. Data passed to the callback is sorted according to the new order of the items. If the order of items is not changed, the same data array as the one passed to the `data` prop of the grid is passed in the callback params.
Called when the drag gesture ends. Data passed to the callback is sorted according to the new order of the items. If the order of items is not changed, the same data array as the one passed to the `data` prop of the grid is passed in the callback params.
0 commit comments