MCPcopy Create free account
hub / github.com/testing-library/user-event / getEventInit

Method getEventInit

src/system/pointer/pointer.ts:140–157  ·  view source on GitHub ↗
(
    /**
     * The `button` that caused the event.
     *
     * This should be `-1` if the event is not caused by a button or touch/pen contact,
     * e.g. a moving pointer.
     */
    button?: MouseButton,
  )

Source from the content-addressed store, hash-verified

138 }
139
140 private getEventInit(
141 /**
142 * The `button` that caused the event.
143 *
144 * This should be `-1` if the event is not caused by a button or touch/pen contact,
145 * e.g. a moving pointer.
146 */
147 button?: MouseButton,
148 ): PointerEventInit {
149 return {
150 ...this.position.coords,
151 pointerId: this.pointerId,
152 pointerType: this.pointerType,
153 isPrimary: this.isPrimary,
154 button: getMouseEventButton(button),
155 buttons: this.buttons.getButtons(),
156 }
157 }
158}

Callers 5

initMethod · 0.95
moveMethod · 0.95
downMethod · 0.95
upMethod · 0.95
releaseMethod · 0.95

Calls 2

getMouseEventButtonFunction · 0.90
getButtonsMethod · 0.80

Tested by

no test coverage detected