whenInteract

Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.when

Wait that an interaction is made with the passed element like “focus”, “focusIn”, “pointerover”, etc…

Params

  1. $elm*-HTMLElement

    The html element you want to monitor

  2. settings{}Partial<IInteractionSettings>

    Some settings to configure your interaction detection

Return

  1. -Promise<HTMLElement>

    A promise that will be resolved when an interaction has been made

Example

import { whenInteract } from '@blackbyte/sugar/dom'
whenInteract($elm).then($elm => {
     // do something...
});

Settings

  1. pointerovertrueboolean

    Specify if you want to detect the pointerover or not

  2. pointerouttrueboolean

    Specify if you want to detect the pointerout or not

  3. pointerdowntrueboolean

    Specify if you want to detect the pointerdown or not

  4. touchstarttrueboolean

    Specify if you want to detect the touchstart or not

  5. touchendtrueboolean

    Specify if you want to detect the touchend or not

  6. focustrueboolean

    Specify if you want to detect the focus or not

Todo

  • testsnormal