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 (this.handlingDownUpSequence) {
|
||||||
if (mapBrowserEvent.type == MapBrowserEventType.POINTERDRAG) {
|
if (mapBrowserEvent.type == MapBrowserEventType.POINTERDRAG) {
|
||||||
this.handleDragEvent(mapBrowserEvent);
|
this.handleDragEvent(mapBrowserEvent);
|
||||||
|
// prevent page scrolling during dragging
|
||||||
|
mapBrowserEvent.preventDefault();
|
||||||
} else if (mapBrowserEvent.type == MapBrowserEventType.POINTERUP) {
|
} else if (mapBrowserEvent.type == MapBrowserEventType.POINTERUP) {
|
||||||
const handledUp = this.handleUpEvent(mapBrowserEvent);
|
const handledUp = this.handleUpEvent(mapBrowserEvent);
|
||||||
this.handlingDownUpSequence =
|
this.handlingDownUpSequence =
|
||||||
|
|||||||
@@ -262,8 +262,7 @@ class Translate extends PointerInteraction {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.lastCoordinate_ = newCoordinate;
|
this.lastCoordinate_ = newCoordinate;
|
||||||
// Prevent page scrolling during drag
|
|
||||||
event.preventDefault();
|
|
||||||
this.dispatchEvent(
|
this.dispatchEvent(
|
||||||
new TranslateEvent(
|
new TranslateEvent(
|
||||||
TranslateEventType.TRANSLATING,
|
TranslateEventType.TRANSLATING,
|
||||||
|
|||||||
Reference in New Issue
Block a user