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

Method down

src/system/pointer/pointer.ts:91–105  ·  view source on GitHub ↗
(instance: Instance, button: MouseButton = 0)

Source from the content-addressed store, hash-verified

89 }
90
91 down(instance: Instance, button: MouseButton = 0) {
92 if (this.isDown) {
93 return
94 }
95 const target = this.getTarget(instance)
96
97 assertPointerEvents(instance, target)
98
99 this.isDown = true
100 this.isPrevented = !instance.dispatchUIEvent(
101 target,
102 'pointerdown',
103 this.getEventInit(button),
104 )
105 }
106
107 up(instance: Instance, button: MouseButton = 0) {
108 if (!this.isDown) {

Callers

nothing calls this directly

Calls 3

getTargetMethod · 0.95
getEventInitMethod · 0.95
assertPointerEventsFunction · 0.90

Tested by

no test coverage detected