From ae0bbb1644d958e33d76d74730350f05deae450b Mon Sep 17 00:00:00 2001 From: luoxiao Date: Tue, 20 Feb 2024 20:55:44 +0800 Subject: [PATCH] fix: modal animation --- thaw/src/modal/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/thaw/src/modal/mod.rs b/thaw/src/modal/mod.rs index 0addd6c..a78a75b 100644 --- a/thaw/src/modal/mod.rs +++ b/thaw/src/modal/mod.rs @@ -15,7 +15,7 @@ pub fn Modal( #[prop(into)] show: Model, #[prop(default = true.into(), into)] mask_closeable: MaybeSignal, #[prop(default = 2000.into(), into)] z_index: MaybeSignal, - #[prop(default = MaybeSignal::Static("75%".to_string()), into)] width: MaybeSignal, + #[prop(default = MaybeSignal::Static("600px".to_string()), into)] width: MaybeSignal, #[prop(optional, into)] title: MaybeSignal, children: Children, #[prop(optional)] modal_footer: Option, @@ -50,16 +50,15 @@ pub fn Modal( let x = -(modal_el.offset_left() - position.0); let y = -(modal_el.offset_top() - position.1 - scroll_top); - let mut style = format!("--thaw-width: {};", width.get_untracked()); - style.push_str(&format!("transform-origin: {}px {}px;", x, y)); - let _ = modal_el.attr("style", style); + let _ = modal_el.attr("style", format!("transform-origin: {}px {}px", x, y)); }; view! {