MapBrowserEvent#preventDefault() behaves the same as with native events

This commit is contained in:
Andreas Hocevar
2021-04-05 10:04:20 +02:00
parent 1cb89ab991
commit 0da0c903a0
5 changed files with 14 additions and 8 deletions
+2 -2
View File
@@ -105,10 +105,10 @@ describe('ol.events.EventTarget', function () {
eventTarget.dispatchEvent('foo');
expect(called).to.eql([1, 2]);
});
it('stops propagation when listeners call preventDefault()', function () {
it('stops propagation when listeners call stopPropagation()', function () {
eventTarget.addEventListener('foo', function (evt) {
spy2();
evt.preventDefault();
evt.stopPropagation();
});
eventTarget.addEventListener('foo', spy1);
eventTarget.dispatchEvent('foo');