Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maddeveloper/reliable-touch-element
An element which provide a stable onTouch event, triggered only if a touchstart and touchend events were triggered on the element, without any touchmove events triggerd on the latter.
https://github.com/maddeveloper/reliable-touch-element
Last synced: 7 days ago
JSON representation
An element which provide a stable onTouch event, triggered only if a touchstart and touchend events were triggered on the element, without any touchmove events triggerd on the latter.
- Host: GitHub
- URL: https://github.com/maddeveloper/reliable-touch-element
- Owner: MadDeveloper
- License: mit
- Created: 2020-03-23T14:33:34.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-23T15:14:09.000Z (almost 5 years ago)
- Last Synced: 2024-12-09T20:46:06.224Z (about 1 month ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# reliable-touch-element
An element providing a reliable `onTouch` callback.
The touch is reliable because the component need to have a `touchstart` and a `touchend` event, without any `touchmove` events, in order to trigger the `onTouch` callback.For example, can be convenient when you have a scrollable list with touchable elements inside, in order to show/display, or navigate to, the element touched.
## Usage
```jsx
import { ReliableTouchElement } from "reliable-touch-element"
// or
import ReliableTouchElement from "reliable-touch-element"
// but prefer the first 😉Hello World!
```
## Props
| Prop | Type | Required | Description |
| ------------- | -------- | -------- | --------------------------------------------------- |
| onTouch | function | yes | Callback triggered when a real touch is detected |
| children | any | no | Children of the element (wrapped in a div). |
| any div props | | | The component accepts any prop a `div` element can. |