down method

  1. @override
Future down(
  1. MouseButton button, {
  2. PageLoaderElement? eventTarget,
})
override

Press at current location. If eventTarget is specified, PageLoader will attempt to fire the corresponding pointer events on that target, otherwise it will fire the events on the target that is under the current location.

Implementation

@override
Future down(MouseButton button, {PageLoaderElement? eventTarget}) =>
    syncFn(() async {
      if (eventTarget != null) {
        await moveTo(eventTarget as HtmlPageLoaderElement, null, null);
      }
      return _dispatchEvent(
          'pointerdown', eventTarget as HtmlPageLoaderElement?, button);
    });