Skip to content

Commit

Permalink
fix: nightly mode Message error
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxiaozero committed Mar 29, 2024
1 parent 0ba8964 commit e26c57e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thaw/src/message/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn Message(message: MessageType, #[prop(into)] on_close: Callback<Uuid, ()>) ->
});
let style = theme.with_untracked(|theme| format!("color: {};", variant.theme_color(theme)));

let on_before_leave = move |_| {
let on_before_leave = Callback::new(move |_| {
let Some(node_el) = message_ref.get() else {
return;
};
Expand All @@ -71,7 +71,7 @@ fn Message(message: MessageType, #[prop(into)] on_close: Callback<Uuid, ()>) ->
let el = any_el.deref();
let style = el.style();
let _ = style.set_property("max-height", &format!("{}px", el.offset_height()));
};
});
let on_after_leave = Callback::new(move |_| {
queue_microtask(move || on_close.call(id));
});
Expand Down

0 comments on commit e26c57e

Please sign in to comment.