-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reworks a few things: - Refactor the code structure to match that of other directives - Rewrite the tests (was faster to do this than figure out the gaps) - Add documentation
- Loading branch information
Showing
6 changed files
with
249 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# onLongPress | ||
|
||
`onLongPress` allows you to bind a callback to a long press occurring (i.e. | ||
a pointer being held down for a specified amount of time). | ||
|
||
## Usage | ||
|
||
```ts | ||
class MyElement extends LitElement { | ||
render() { | ||
return html` | ||
<div ${onLongPress(this._onLongPress)}> | ||
Long press me! | ||
</div> | ||
`; | ||
} | ||
} | ||
``` | ||
|
||
This will call the `_onLongPress` method when the user holds their pointer | ||
down for 1 second (the default). | ||
|
||
The parameters (`onLongPress(fn, time)`) are as follows: | ||
|
||
- `fn` - a function to call when the pointer has been held long enough | ||
- `time` - the time in milliseconds to consider a press being 'long' | ||
|
||
## Options | ||
|
||
N/A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.