MapBrowserEvent#preventDefault() behaves the same as with native events
This commit is contained in:
@@ -16,10 +16,10 @@ describe('ol.events.Event', function () {
|
||||
});
|
||||
|
||||
describe('#preventDefault', function () {
|
||||
it('sets the propagationStopped flag', function () {
|
||||
it('sets the defaultPrevented flag', function () {
|
||||
const event = new Event('foo');
|
||||
event.preventDefault();
|
||||
expect(event.propagationStopped).to.be(true);
|
||||
expect(event.defaultPrevented).to.be(true);
|
||||
});
|
||||
it('does the same as #stopPropagation', function () {
|
||||
const event = new Event('foo');
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user