Skip to content

Discussion tracking: Event dispatching / listening between AFFINE and Blocksuite #198

Answered by lawvs
thorseraq asked this question in Q&A
Discussion options

You must be logged in to vote

I met a question that when window dispatches an event, (the Capture phrase is disabled by default) this event bubbles up from the "window" element, which element will receive this event? (window seems don't have any parent element) .

You can read the DOM spec for a more detailed explanation. The parent of the window is null and the event will stop bubbling.

https://dom.spec.whatwg.org/#dispatching-events

Each EventTarget object also has an associated get the parent algorithm, which takes an event event, and returns an EventTarget object. Unless specified otherwise it returns null.

Nodes, shadow roots, and documents override the get the parent algorithm.

https://dom.spec.whatwg.org/#get…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by thorseraq
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
good first issue Good for newcomers
2 participants
Converted from issue

This discussion was converted from issue #192 on November 10, 2022 08:22.