Skip to content

Commit 2f7fad5

Browse files
committed
fix(ngMock.browserTrigger): add 'bubbles' to Transition/Animation Event
When the event objects are created synthetically, the bubbles property is set to false if not explicitly defined
1 parent ecc09a4 commit 2f7fad5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ngMock/browserTrigger.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,25 @@
5555
if (/transitionend/.test(eventType)) {
5656
if (window.WebKitTransitionEvent) {
5757
evnt = new window.WebKitTransitionEvent(eventType, eventData);
58-
evnt.initEvent(eventType, false, true);
58+
evnt.initEvent(eventType, eventData.bubbles, true);
5959
} else {
6060
try {
6161
evnt = new window.TransitionEvent(eventType, eventData);
6262
} catch (e) {
6363
evnt = window.document.createEvent('TransitionEvent');
64-
evnt.initTransitionEvent(eventType, null, null, null, eventData.elapsedTime || 0);
64+
evnt.initTransitionEvent(eventType, eventData.bubbles, null, null, eventData.elapsedTime || 0);
6565
}
6666
}
6767
} else if (/animationend/.test(eventType)) {
6868
if (window.WebKitAnimationEvent) {
6969
evnt = new window.WebKitAnimationEvent(eventType, eventData);
70-
evnt.initEvent(eventType, false, true);
70+
evnt.initEvent(eventType, eventData.bubbles, true);
7171
} else {
7272
try {
7373
evnt = new window.AnimationEvent(eventType, eventData);
7474
} catch (e) {
7575
evnt = window.document.createEvent('AnimationEvent');
76-
evnt.initAnimationEvent(eventType, null, null, null, eventData.elapsedTime || 0);
76+
evnt.initAnimationEvent(eventType, eventData.bubbles, null, null, eventData.elapsedTime || 0);
7777
}
7878
}
7979
} else if (/touch/.test(eventType) && supportsTouchEvents()) {

0 commit comments

Comments
 (0)