diff --git a/thaw/src/scrollbar/mod.rs b/thaw/src/scrollbar/mod.rs index 6ad6411..a7ec175 100644 --- a/thaw/src/scrollbar/mod.rs +++ b/thaw/src/scrollbar/mod.rs @@ -277,6 +277,29 @@ pub fn Scrollbar( thumb_status.set_value(Some(ThumbStatus::Enter)); }; + on_cleanup(move || { + x_trumb_mousemove_handle.update_value(|handle| { + if let Some(handle) = handle.take() { + handle.remove(); + } + }); + x_trumb_mouseup_handle.update_value(|handle| { + if let Some(handle) = handle.take() { + handle.remove(); + } + }); + y_trumb_mousemove_handle.update_value(|handle| { + if let Some(handle) = handle.take() { + handle.remove(); + } + }); + y_trumb_mouseup_handle.update_value(|handle| { + if let Some(handle) = handle.take() { + handle.remove(); + } + }); + }); + view! {