redirectOnTouchStartToMouseEvent function

void redirectOnTouchStartToMouseEvent(
  1. Element element
)

Redirects element.onTouchStart to element.onMouseDown as MouseEvent.

Implementation

void redirectOnTouchStartToMouseEvent(Element element) {
  element.onTouchStart.listen((event) {
    var mouseEvent = touchEventToMouseEvent(event);
    if (mouseEvent != null) {
      element.dispatchEvent(mouseEvent);
    }
  });
}