Skip to content

Commit

Permalink
0.63.3 release - update Pressable delay (#2226)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simek authored Sep 30, 2020
1 parent b831490 commit 2c11509
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions docs/pressable.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ On an element wrapped by `Pressable`:
After pressing [`onPressIn`](#onpressin), one of two things will happen:
1. The person will remove their finger, triggering [`onPressOut`](#onpressout) followed by [`onPress`](#onpress).
2. If the person leaves their finger longer than 370 milliseconds before removing it, [`onLongPress`](#onlongpress) is triggered. ([`onPressOut`](#onpressout) will still fire when they remove their finger.)
2. If the person leaves their finger longer than 500 milliseconds before removing it, [`onLongPress`](#onlongpress) is triggered. ([`onPressOut`](#onpressout) will still fire when they remove their finger.)
<img src="/docs/assets/d_pressable_pressing.svg" width="1000" alt="Diagram of the onPress events in sequence." />
Fingers are not the most precise instruments, and it is common for users to accidentally activate the wrong element or miss the activation area. To help, `Pressable` has an optional `HitRect` you can use to define how far a touch can register away from the the wrapped element. Presses can start anywhere within a `HitRect`.
Fingers are not the most precise instruments, and it is common for users to accidentally activate the wrong element or miss the activation area. To help, `Pressable` has an optional `HitRect` you can use to define how far a touch can register away from the wrapped element. Presses can start anywhere within a `HitRect`.
`PressRect` allows presses to move beyond the element and its `HitRect` while maintaining activation and being eligible for a "press"—think of sliding your finger slowly away from a button you're pressing down on.

Expand Down Expand Up @@ -135,7 +135,7 @@ Duration (in milliseconds) from `onPressIn` before `onLongPress` is called.

| Type | Required | Default |
| ------ | -------- | ------- |
| number | No | 370 |
| number | No | `500` |

### `disabled`

Expand All @@ -155,7 +155,7 @@ Sets additional distance outside of element in which a press can be detected.

### `onLongPress`

Called if the time after `onPressIn` lasts longer than 370 milliseconds. This time period can be customized with [`delayLongPress`](#delaylongpress).
Called if the time after `onPressIn` lasts longer than 500 milliseconds. This time period can be customized with [`delayLongPress`](#delaylongpress).

| Type | Required |
| ------------------------ | -------- |
Expand Down
2 changes: 1 addition & 1 deletion website/static/docs/assets/d_pressable_pressing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions website/versioned_docs/version-0.63/pressable.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Pressable
original_id: pressable
---

Pressable is a Core Component wrapper that can detect various stages of press interactions on any of it's defined children.
Pressable is a Core Component wrapper that can detect various stages of press interactions on any of its defined children.

```jsx
<Pressable onPress={onPressFunction}>
Expand All @@ -22,9 +22,9 @@ On an element wrapped by `Pressable`:
After pressing [`onPressIn`](#onpressin), one of two things will happen:
1. The person will remove their finger, triggering [`onPressOut`](#onpressout) followed by [`onPress`](#onpress).
2. If the person leaves their finger longer than 370 milliseconds before removing it, [`onLongPress`](#onlongpress) is triggered. ([`onPressOut`](#onpressout) will still fire when they remove their finger.)
2. If the person leaves their finger longer than 500 milliseconds before removing it, [`onLongPress`](#onlongpress) is triggered. ([`onPressOut`](#onpressout) will still fire when they remove their finger.)
<img src="/docs/assets/d_pressable_pressing.svg" width="1000" alt="Diagram of the onPress events in sequence.">
<img src="/docs/assets/d_pressable_pressing.svg" width="1000" alt="Diagram of the onPress events in sequence." />
Fingers are not the most precise instruments, and it is common for users to accidentally activate the wrong element or miss the activation area. To help, `Pressable` has an optional `HitRect` you can use to define how far a touch can register away from the wrapped element. Presses can start anywhere within a `HitRect`.
Expand Down Expand Up @@ -136,7 +136,7 @@ Duration (in milliseconds) from `onPressIn` before `onLongPress` is called.

| Type | Required | Default |
| ------ | -------- | ------- |
| number | No | 370 |
| number | No | `500` |

### `disabled`

Expand All @@ -156,7 +156,7 @@ Sets additional distance outside of element in which a press can be detected.

### `onLongPress`

Called if the time after `onPressIn` lasts longer than 370 milliseconds. This time period can be customized with [`delayLongPress`](#delaylongpress).
Called if the time after `onPressIn` lasts longer than 500 milliseconds. This time period can be customized with [`delayLongPress`](#delaylongpress).

| Type | Required |
| ------------------------ | -------- |
Expand Down

0 comments on commit 2c11509

Please sign in to comment.