Skip to content

Commit 7d99c35

Browse files
authored
fix(cdk/testing): avoid using dotted property access for dispatchEven… (#20754)
* fix(cdk/testing): avoid using dotted property access for dispatchEvent on ElementFinder * Internally this was causing an error saying that the type has a string index signature, but it is being accessed using a dotted property access. * fixup! fix(cdk/testing): avoid using dotted property access for dispatchEvent on ElementFinder
1 parent a217509 commit 7d99c35

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cdk/testing/protractor/protractor-element.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,5 +212,6 @@ export class ProtractorElement implements TestElement {
212212
function _dispatchEvent(name: string, element: ElementFinder) {
213213
const event = document.createEvent('Event');
214214
event.initEvent(name);
215-
element.dispatchEvent(event);
215+
// This type has a string index signature, so we cannot access it using a dotted property access.
216+
element['dispatchEvent'](event);
216217
}

0 commit comments

Comments
 (0)