From 251fb60b1e967d83eeb9adc4f3808120cb5c83f0 Mon Sep 17 00:00:00 2001 From: Azriel Hoh Date: Sat, 4 Oct 2025 15:37:16 +1300 Subject: [PATCH] Support `ToggleEvent` for `on:toggle`. --- tachys/Cargo.toml | 1 + tachys/src/html/event.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tachys/Cargo.toml b/tachys/Cargo.toml index bcab009f3c..7b2233940c 100644 --- a/tachys/Cargo.toml +++ b/tachys/Cargo.toml @@ -72,6 +72,7 @@ web-sys = { features = [ "SecurityPolicyViolationEvent", "StorageEvent", "SubmitEvent", + "ToggleEvent", "TouchEvent", "TransitionEvent", "UiEvent", diff --git a/tachys/src/html/event.rs b/tachys/src/html/event.rs index 8083b5e9f7..c1addd52a3 100644 --- a/tachys/src/html/event.rs +++ b/tachys/src/html/event.rs @@ -614,7 +614,7 @@ generate_event_types! { animation start: AnimationEvent, aux click: MouseEvent, before input: InputEvent, - before toggle: Event, // web_sys does not include `ToggleEvent` + before toggle: ToggleEvent, #[does_not_bubble] blur: FocusEvent, #[does_not_bubble] @@ -725,7 +725,7 @@ generate_event_types! { #[does_not_bubble] time update: Event, #[does_not_bubble] - toggle: Event, + toggle: ToggleEvent, touch cancel: TouchEvent, touch end: TouchEvent, touch move: TouchEvent,