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:
Reinis Mazeiks authored and GitHub committed 2022-08-10 07:23:27 -05:00
1 parent 9538cfe733
commit c801d4402e
3 files changed
+2 -1

No files matched your search

+1
View File
@@ -7,6 +7,7 @@ on:
paths:
- packages/**
- examples/**
- docs/guide/**
- src/**
- .github/**
- 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:
```rust
{{#include ../../../examples/event_click.rs:rsx}}
{{#include ../../../examples/event_nested.rs:rsx}}
```
## Prevent Default
File renamed without changes.