Actions
Long Press
Description
The Long Press action allows for detecting when an element is being pressed for a certain period of time.
Usage
<script lang="ts">
import { long_press, type LongPressParameters } from 'action-archive';
const longPressParameters: LongPressParameters = {
duration: 500,
};
</script>
<button use:long_press={longPressParameters} on:aa_long_press={...}>Press</button>
Example
API
Parameters
Name | Type | Default | Description |
---|---|---|---|
duration | number | 500 | Number of milliseconds that the element needs to be pressed for before the aa_long_press event is emitted. |
disabled | boolean | false | Disables the action. |
Events
Name | Type | Description |
---|---|---|
aa_long_press | (event: CustomEvent) => void | Emitted when the element is pressed for the set duration. |