You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.
If the event listeners are added via properties (like in GWT for example) then using shadydom in IE 11 could cause several issues because the events will use the capturing phase logic and not the default/expected bubbling phase.
Strange thing but removing the empty object from that line solves the issue. As I've debugged it the optionsOrCapture is handled properly in the patch-events.js but still IE 11 somehow uses capturing phase if it is used.
The following test should be ok for that. I'll create a PR if I found time for that soon.
test('should use bubbling phase for event listeners added via properties', function () {
const parent = document.createElement('div');
parent.id="parent";
document.body.appendChild(parent);
const child = document.createElement('div');
child.id="child";
parent.appendChild(child);
const parentMouseDownSpy = sinon.spy();
const childMouseDownSpy = sinon.spy();
parent.onmousedown = parentMouseDownSpy;
child.onmousedown = childMouseDownSpy;
child.dispatchEvent(new MouseEvent('mousedown', { bubbles: true, composed: true }));
assert.isTrue(childMouseDownSpy.calledBefore(parentMouseDownSpy), 'Event handler on child should be called first');
});
Yeah, that empty object forces capture phase in browsers not supporting event listener options.
Looks like the intervention for passive event listeners strikes again.
Description
If the event listeners are added via properties (like in GWT for example) then using shadydom in IE 11 could cause several issues because the events will use the capturing phase logic and not the default/expected bubbling phase.
Live Demo
https://jsbin.com/tojafuvowo/1/edit?html,js,output
Steps to Reproduce
Expected Results
Triggering a related event should be dispatched first on the children if that was the target.
Actual Results
The event is dispatched first on parent (capturing phase).
Browsers Affected
Versions
The text was updated successfully, but these errors were encountered: