shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
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
- $elm*-HTMLElement
The html element you want to monitor
- settings{}Partial<IInteractionSettings>
Some settings to configure your interaction detection
Return
- -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
- pointerovertrueboolean
Specify if you want to detect the pointerover or not
- pointerouttrueboolean
Specify if you want to detect the pointerout or not
- pointerdowntrueboolean
Specify if you want to detect the pointerdown or not
- touchstarttrueboolean
Specify if you want to detect the touchstart or not
- touchendtrueboolean
Specify if you want to detect the touchend or not
- focustrueboolean
Specify if you want to detect the focus or not
Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space