mirror of
https://github.com/adoyle0/thaw.git
synced 2025-02-02 08:34:15 -05:00
fix: Scrollbar nested update value (#238)
This commit is contained in:
parent
74bf7fa29a
commit
97212d7fda
1 changed files with 14 additions and 14 deletions
|
@ -198,15 +198,15 @@ pub fn Scrollbar(
|
||||||
handle.remove();
|
handle.remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
thumb_status.update_value(|thumb_status| {
|
if let Some(Some(status)) =
|
||||||
if let Some(status) = thumb_status.take() {
|
thumb_status.try_update_value(|thumb_status| thumb_status.take())
|
||||||
|
{
|
||||||
if status == ThumbStatus::DelayLeave {
|
if status == ThumbStatus::DelayLeave {
|
||||||
is_show_x_thumb.set(false);
|
is_show_x_thumb.set(false);
|
||||||
is_show_y_thumb.set(false);
|
is_show_y_thumb.set(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
x_trumb_mouseup_handle.set_value(Some(handle));
|
x_trumb_mouseup_handle.set_value(Some(handle));
|
||||||
memo_x_left.set_value(container_scroll_left.get());
|
memo_x_left.set_value(container_scroll_left.get());
|
||||||
memo_mouse_x.set_value(e.client_x());
|
memo_mouse_x.set_value(e.client_x());
|
||||||
|
@ -251,15 +251,15 @@ pub fn Scrollbar(
|
||||||
handle.remove();
|
handle.remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
thumb_status.update_value(|thumb_status| {
|
if let Some(Some(status)) =
|
||||||
if let Some(status) = thumb_status.take() {
|
thumb_status.try_update_value(|thumb_status| thumb_status.take())
|
||||||
|
{
|
||||||
if status == ThumbStatus::DelayLeave {
|
if status == ThumbStatus::DelayLeave {
|
||||||
is_show_x_thumb.set(false);
|
is_show_x_thumb.set(false);
|
||||||
is_show_y_thumb.set(false);
|
is_show_y_thumb.set(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
y_trumb_mouseup_handle.set_value(Some(handle));
|
y_trumb_mouseup_handle.set_value(Some(handle));
|
||||||
memo_y_top.set_value(container_scroll_top.get());
|
memo_y_top.set_value(container_scroll_top.get());
|
||||||
memo_mouse_y.set_value(e.client_y());
|
memo_mouse_y.set_value(e.client_y());
|
||||||
|
|
Loading…
Add table
Reference in a new issue