disableDoubleClicks function

void disableDoubleClicks()

Disables browser double clicks/tap.

  • This calls Event.preventDefault for every double click/tap event.
    • This is useful to prevent double tap zooming.

Implementation

void disableDoubleClicks() {
  if (_disableDoubleTapZoom) return;
  _disableDoubleTapZoom = true;

  document.addEventListener('dblclick', (event) {
    event.preventDefault();
  }, true);
}