Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/routes/concepts/components/event-handlers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Solid provides two ways to add event listeners to the browser:
- [`on:__`](/reference/jsx-attributes/on): adds an event listener to the `element`. This is also known as a _native event_.
- [`on__`](/reference/jsx-attributes/on_): adds an event listener to the `document` and dispatches it to the `element`. This can be referred to as a _delegated event_.

Delegated events flow through the [_component tree_](/concepts/components/basics#component-trees), and save some resources by performing better on commonly used events.
Native events, however, flow through the _DOM tree_, and provide more control over the behavior of the event.
Delegated events conserve resources and improve performance for commonly used events by sharing a single handler.
Native events, conversely, offer greater control over event behavior.

## Using events

Expand Down Expand Up @@ -95,7 +95,7 @@ If you need to attach an event listener to an element that is not supported by S

While delegated events provide some performance enhancements, there are tradeoffs.

Event delegation is designed for event propagation through the JSX Tree, rather than the DOM Tree.
Delegated events flow through native element parents but can be overriden by components like Portal.
This can differ from the previous expectations of how events work and flow.

Some things to keep in mind include:
Expand Down