Search.../

Introduction

Important:

  • This API is only relevant for custom widgets in Branded Apps.
  • Custom widgets are not yet available to all users.
  • This API is in Developer Preview and is subject to change.

MobilePressableMixin provides event handlers that run when an element on a mobile app is pressed or long-pressed.

About Mixins

Mixins provide functionality that other elements can inherit and use.

Mixins are not elements. You cannot add mixins to the Editor like other $w elements, and mixins are not meant to be used directly in your code.

For example, you would not write code like this, because it is out of context:

$w("#PressableMixin").onPress( (event) => {
let targetId = event.target.id;
}
);
javascript | Copy Code

Instead, you can code the following if myMobileButton is an element that can be pressed and
"mixes in" PressableMixin.

$w("#myMobileButton").onPress( (event) => {
let targetId = event.target.id;
}
);
javascript | Copy Code

Was this helpful?