Do not preventDefault on pointerdown
This commit is contained in:
@@ -146,9 +146,6 @@ class PointerInteraction extends Interaction {
|
|||||||
} else {
|
} else {
|
||||||
if (mapBrowserEvent.type == MapBrowserEventType.POINTERDOWN) {
|
if (mapBrowserEvent.type == MapBrowserEventType.POINTERDOWN) {
|
||||||
const handled = this.handleDownEvent(mapBrowserEvent);
|
const handled = this.handleDownEvent(mapBrowserEvent);
|
||||||
if (handled) {
|
|
||||||
mapBrowserEvent.preventDefault();
|
|
||||||
}
|
|
||||||
this.handlingDownUpSequence = handled;
|
this.handlingDownUpSequence = handled;
|
||||||
stopEvent = this.stopDown(handled);
|
stopEvent = this.stopDown(handled);
|
||||||
} else if (mapBrowserEvent.type == MapBrowserEventType.POINTERMOVE) {
|
} else if (mapBrowserEvent.type == MapBrowserEventType.POINTERMOVE) {
|
||||||
|
|||||||
@@ -22,14 +22,14 @@ describe('ol.interaction.Pointer', function() {
|
|||||||
defaultPrevented = false;
|
defaultPrevented = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('prevents default on handled down event', function() {
|
it('does not prevent default on handled down event', function() {
|
||||||
const interaction = new PointerInteraction({
|
const interaction = new PointerInteraction({
|
||||||
handleDownEvent: function() {
|
handleDownEvent: function() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
interaction.handleEvent(event);
|
interaction.handleEvent(event);
|
||||||
expect(defaultPrevented).to.be(true);
|
expect(defaultPrevented).to.be(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not prevent default on unhandled down event', function() {
|
it('does not prevent default on unhandled down event', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user