Skip to content

Commit a306e93

Browse files
mprobstmmalerba
authored andcommitted
chore(testing): fix compilation for TS3.6. (#17218)
TS3.6 no longer includes the initUIEvent method.
1 parent bf304e9 commit a306e93

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cdk/testing/event-objects.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export function createTouchEvent(type: string, pageX = 0, pageY = 0) {
6161
const event = document.createEvent('UIEvent');
6262
const touchDetails = {pageX, pageY};
6363

64-
event.initUIEvent(type, true, true, window, 0);
64+
// TS3.6 removes the initUIEvent method and suggests porting to "new UIEvent()".
65+
(event as any).initUIEvent(type, true, true, window, 0);
6566

6667
// Most of the browsers don't have a "initTouchEvent" method that can be used to define
6768
// the touch details.

0 commit comments

Comments
 (0)