mirror of
https://github.com/adoyle0/thaw.git
synced 2025-01-22 22:09:22 -05:00
fix: events were not removed when the scrollbar cleared (#216)
This commit is contained in:
parent
96f74a122e
commit
0f09a7eaa0
1 changed files with 23 additions and 0 deletions
|
@ -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! {
|
||||
<div
|
||||
class=class_list!["thaw-scrollbar", class.map(| c | move || c.get())]
|
||||
|
|
Loading…
Add table
Reference in a new issue