MCPcopy
hub / github.com/hotwired/stimulus / willBeInvokedByEvent

Method willBeInvokedByEvent

src/core/binding.ts:86–104  ·  view source on GitHub ↗
(event: Event)

Source from the content-addressed store, hash-verified

84 }
85
86 private willBeInvokedByEvent(event: Event): boolean {
87 const eventTarget = event.target
88
89 if (event instanceof KeyboardEvent && this.action.shouldIgnoreKeyboardEvent(event)) {
90 return false
91 }
92
93 if (event instanceof MouseEvent && this.action.shouldIgnoreMouseEvent(event)) {
94 return false
95 }
96
97 if (this.element === eventTarget) {
98 return true
99 } else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {
100 return this.scope.containsElement(eventTarget)
101 } else {
102 return this.scope.containsElement(this.action.element)
103 }
104 }
105
106 private get controller(): Controller {
107 return this.context.controller

Callers 1

handleEventMethod · 0.95

Calls 2

Tested by

no test coverage detected