Merge pull request #10941 from ahocevar/prevent-scroll-on-drag

Always prevent default after handleDragEvent
This commit is contained in:
Andreas Hocevar
2020-04-18 17:31:00 +02:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -138,6 +138,8 @@ class PointerInteraction extends Interaction {
if (this.handlingDownUpSequence) {
if (mapBrowserEvent.type == MapBrowserEventType.POINTERDRAG) {
this.handleDragEvent(mapBrowserEvent);
// prevent page scrolling during dragging
mapBrowserEvent.preventDefault();
} else if (mapBrowserEvent.type == MapBrowserEventType.POINTERUP) {
const handledUp = this.handleUpEvent(mapBrowserEvent);
this.handlingDownUpSequence =

View File

@@ -262,8 +262,7 @@ class Translate extends PointerInteraction {
});
this.lastCoordinate_ = newCoordinate;
// Prevent page scrolling during drag
event.preventDefault();
this.dispatchEvent(
new TranslateEvent(
TranslateEventType.TRANSLATING,