Skip to content

Commit 958cb8b

Browse files
titoBouzoutkodiakhq[bot]LadyBluenotes
authored
Improve wording on delegated events propagation (#1217)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Sarah <[email protected]>
1 parent 4def55e commit 958cb8b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/routes/concepts/components/event-handlers.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Solid provides two ways to add event listeners to the browser:
1010
- [`on:__`](/reference/jsx-attributes/on): adds an event listener to the `element`. This is also known as a _native event_.
1111
- [`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_.
1212

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

1616
## Using events
1717

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

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

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

101101
Some things to keep in mind include:

0 commit comments

Comments
 (0)