fix: nightly Callback

This commit is contained in:
luoxiao 2024-04-08 23:07:54 +08:00 committed by luoxiaozero
parent 683fcd8a36
commit f1c3882b72
2 changed files with 4 additions and 4 deletions

View file

@ -78,9 +78,9 @@ pub fn Drawer(
show.set(false);
}
};
let on_esc = move |_: ev::KeyboardEvent| {
let on_esc = Callback::new(move |_: ev::KeyboardEvent| {
show.set(false);
};
});
view! {
<FocusTrap disabled=!close_on_esc active=show.signal() on_esc>

View file

@ -34,9 +34,9 @@ pub fn Modal(
show.set(false);
}
};
let on_esc = move |_: ev::KeyboardEvent| {
let on_esc = Callback::new(move |_: ev::KeyboardEvent| {
show.set(false);
};
});
let mask_ref = NodeRef::<html::Div>::new();
let scrollbar_ref = ComponentRef::<ScrollbarRef>::new();