Merge pull request #10941 from ahocevar/prevent-scroll-on-drag
Always prevent default after handleDragEvent
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -262,8 +262,7 @@ class Translate extends PointerInteraction {
|
||||
});
|
||||
|
||||
this.lastCoordinate_ = newCoordinate;
|
||||
// Prevent page scrolling during drag
|
||||
event.preventDefault();
|
||||
|
||||
this.dispatchEvent(
|
||||
new TranslateEvent(
|
||||
TranslateEventType.TRANSLATING,
|
||||
|
||||
Reference in New Issue
Block a user