redirectOnTouchEndToMouseEvent function

void redirectOnTouchEndToMouseEvent(
  1. Element element
)

Redirects element.onTouchEnd to element.onMouseUp as MouseEvent.

Implementation

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