Parcourir la source

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)
Reinis Mazeiks il y a 2 ans
Parent
commit
c801d4402e

+ 1 - 0
.github/workflows/main.yml

@@ -7,6 +7,7 @@ on:
     paths:
       - packages/**
       - examples/**
+      - docs/guide/**
       - src/**
       - .github/**
       - lib.rs

+ 1 - 1
docs/guide/src/en/interactivity/event_handlers.md

@@ -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

+ 0 - 0
docs/guide/src/en/lib.rs → docs/guide/src/lib.rs