From 75504ec4fc4e8b589fe80e1e8434bbe4ccb50892 Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Thu, 21 Dec 2023 22:07:00 -0800 Subject: [PATCH] Actaully previous way was correct, event handlers on parent --- examples/demo.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/demo.rs b/examples/demo.rs index 7fb8da9..ec5d395 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -80,12 +80,12 @@ fn SceneTree<'a>(cx: Scope, selected_entity: &'a UseState>) -> El } } node { + onclick: move |_| spawn_entity(), + onmouse_enter: enter, + onmouse_exit: exit, padding: "8", background_color: if spawn_entity_hovered { NEUTRAL_600 } else { NEUTRAL_800 }, text { - onclick: move |_| spawn_entity(), - onmouse_enter: enter, - onmouse_exit: exit, text: "Spawn Entity", text_size: "18" }