Fix propagation docs (#526)
* Fix typo - wrong example for "stopping propagation" section * Move `lib.rs` in guide back to `src` * Make sure tests get run when guide is updated (there's examples in the guide to check for compilation errors)
This commit is contained in:
1 parent
9538cfe733
commit
c801d4402e
3 files changed
+2
-1
No files matched your search
@@ -7,6 +7,7 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- packages/**
|
- packages/**
|
||||||
- examples/**
|
- examples/**
|
||||||
|
- docs/guide/**
|
||||||
- src/**
|
- src/**
|
||||||
- .github/**
|
- .github/**
|
||||||
- lib.rs
|
- lib.rs
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ To learn what the different event types provide, read the [events module docs](h
|
|||||||
When you have e.g. a `button` inside a `div`, any click on the `button` is also a click on the `div`. For this reason, Dioxus propagates the click event: first, it is triggered on the target element, then on parent elements. If you want to prevent this behavior, you can call `cancel_bubble()` on the event:
|
When you have e.g. a `button` inside a `div`, any click on the `button` is also a click on the `div`. For this reason, Dioxus propagates the click event: first, it is triggered on the target element, then on parent elements. If you want to prevent this behavior, you can call `cancel_bubble()` on the event:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
{{#include ../../../examples/event_click.rs:rsx}}
|
{{#include ../../../examples/event_nested.rs:rsx}}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Prevent Default
|
## Prevent Default
|
||||||
|
|||||||
File renamed without changes.
Reference in new issue
Block a user