From aa793e16e19c8086efe33ee3dbac737a28263476 Mon Sep 17 00:00:00 2001 From: luoxiaozero <48741584+luoxiaozero@users.noreply.github.com> Date: Sat, 13 Apr 2024 18:17:54 +0800 Subject: [PATCH] fix: ssr mode input default value (#163) --- thaw/src/input/mod.rs | 11 +++++++++++ thaw/src/input_number/mod.rs | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/thaw/src/input/mod.rs b/thaw/src/input/mod.rs index 5ab5a4f..0403f39 100644 --- a/thaw/src/input/mod.rs +++ b/thaw/src/input/mod.rs @@ -140,6 +140,16 @@ pub fn Input( } }; + let input_value: Option; + #[cfg(feature = "ssr")] + { + input_value = Some(value.get_untracked()); + } + #[cfg(not(feature = "ssr"))] + { + input_value = None; + } + #[cfg(debug_assertions)] { const INNER_ATTRS: [&str; 4] = ["type", "class", "disabled", "placeholder"]; @@ -173,6 +183,7 @@ pub fn Input(