-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(core): Add a new EventDispatcher
class.
#55837
Conversation
4ae90c9
to
ebbeb04
Compare
TESTED=TGP |
ebbeb04
to
6c832bf
Compare
6c832bf
to
f7b0c1e
Compare
f7b0c1e
to
63606b5
Compare
packages/core/primitives/event-dispatch/src/event_dispatcher.ts
Outdated
Show resolved
Hide resolved
packages/core/primitives/event-dispatch/src/event_dispatcher.ts
Outdated
Show resolved
Hide resolved
packages/core/primitives/event-dispatch/src/event_dispatcher.ts
Outdated
Show resolved
Hide resolved
`EventDispatcher` emulates the browser's event dispatch (mostly). It supports: - Bubbling and `stopPropagation`/`stopImmediatePropagation`. - `currentTarget` during dispatch. - Throwing errors for `preventDefault` if the event is being dispatched in replay. - Throwing errors for `composedPath()` if event is being dispatched in replay.
e6e896e
to
41390a4
Compare
packages/core/primitives/event-dispatch/src/event_dispatcher.ts
Outdated
Show resolved
Hide resolved
packages/core/primitives/event-dispatch/src/event_dispatcher.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tbondwilkinson thanks for creating the patchEventInstance
function and documenting the context (it's very helpful!) 👍
packages/core/primitives/event-dispatch/src/event_dispatcher.ts
Outdated
Show resolved
Hide resolved
45e54bc
to
696197f
Compare
Caretaker note: The mergeability presubmits appear stuck |
@tbondwilkinson I think it got stuck because we just released v18, so the rc branch no longer exists. Weird edge case bug. |
This PR was merged into the repository by commit fdd59c4. |
`EventDispatcher` emulates the browser's event dispatch (mostly). It supports: - Bubbling and `stopPropagation`/`stopImmediatePropagation`. - `currentTarget` during dispatch. - Throwing errors for `preventDefault` if the event is being dispatched in replay. - Throwing errors for `composedPath()` if event is being dispatched in replay. PR Close #55837
EventDispatcher
emulates the browser's event dispatch (mostly). It supports:stopPropagation
/stopImmediatePropagation
.currentTarget
during dispatch.preventDefault
if the event is being dispatched in replay.composedPath()
if event is being dispatched in replay.PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?