Search...
onPressIn( )
Adds an event handler that runs immediately when an element on a mobile app is pressed.
Description
A mobile element receives an event
immediately when a mobile app user presses on the element.
The onPressIn()
function runs before the onPress()
and onLongPress()
functions.
Syntax
function onPressIn(handler: EventHandler): MobileElementhandler: function EventHandler(event: Event): void
onPressIn Parameters
NAME
TYPE
DESCRIPTION
handler
The name of the function or the function expression to run when an element on a mobile app is pressed.
EventHandler Parameters
NAME
TYPE
DESCRIPTION
Returns
This function does not return anything.
Return Type:
void
Mixed in from:$w.MobilePressableMixin
Was this helpful?
Get the ID of the mobile button immediately when the button is pressed
Copy Code
1$w('#mobileButton1').onPressIn( (event) => {2 let targetId = event.target.id; // 'mobileButton1'3} );
Change the mobile button's label immediately when the button is pressed
Copy Code
1$w('mobileButton1').onPressIn((event) => {2 $w('#mobileButton1').label = 'Order Now';3});