MCPcopy Create free account
hub / github.com/angular/components / click

Method click

src/cdk/testing/testbed/unit-test-element.ts:104–117  ·  view source on GitHub ↗
(
    ...args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?]
  )

Source from the content-addressed store, hash-verified

102 */
103 click(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;
104 async click(
105 ...args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?]
106 ): Promise<void> {
107 const isDisabled = (this.element as Partial<{disabled?: boolean}>).disabled === true;
108
109 // If the element is `disabled` and has a `disabled` property, we emit the mouse event
110 // sequence but not dispatch the `click` event. This is necessary to keep the behavior
111 // consistent with an actual user interaction. The click event is not necessarily
112 // automatically prevented by the browser. There is mismatch between Firefox and Chromium:
113 // https://bugzilla.mozilla.org/show_bug.cgi?id=329509.
114 // https://bugs.chromium.org/p/chromium/issues/detail?id=1115661.
115 await this._dispatchMouseEventSequence(isDisabled ? null : 'click', args, 0);
116 await this._stabilize();
117 }
118
119 /**
120 * Right clicks on the element at the specified coordinates relative to the top-left of it.

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected