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

NameTypeDefaultDescription
durationnumber500Number of milliseconds that the element needs to be pressed for before the aa_long_press event is emitted.
disabledbooleanfalseDisables the action.

Events

NameTypeDescription
aa_long_press(event: CustomEvent) => voidEmitted when the element is pressed for the set duration.