From c801d4402e5d3eb293da9cc56e1ff1b3a527d5df Mon Sep 17 00:00:00 2001 From: Reinis Mazeiks Date: Wed, 10 Aug 2022 15:23:27 +0300 Subject: [PATCH] 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) --- .github/workflows/main.yml | 1 + docs/guide/src/en/interactivity/event_handlers.md | 2 +- docs/guide/src/{en => }/lib.rs | 0 3 files changed, 2 insertions(+), 1 deletion(-) rename docs/guide/src/{en => }/lib.rs (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1ebe08005..40641e8a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,7 @@ on: paths: - packages/** - examples/** + - docs/guide/** - src/** - .github/** - lib.rs diff --git a/docs/guide/src/en/interactivity/event_handlers.md b/docs/guide/src/en/interactivity/event_handlers.md index 510c77e24..77054f3fe 100644 --- a/docs/guide/src/en/interactivity/event_handlers.md +++ b/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 diff --git a/docs/guide/src/en/lib.rs b/docs/guide/src/lib.rs similarity index 100% rename from docs/guide/src/en/lib.rs rename to docs/guide/src/lib.rs