Fix cursor and hover styles changing when dragging the mouse
This commit is contained in:
parent
1320fadc30
commit
4d2f5a8e04
3 changed files with 26 additions and 15 deletions
|
@ -42,7 +42,11 @@ where
|
|||
let mut handler = MouseEventHandler::above::<Tag, _>(region_id, cx, |state, cx| {
|
||||
// Observing hovered will cause a render when the mouse enters regardless
|
||||
// of if mouse position was accessed before
|
||||
let drag_position = if state.hovered() { drag_position } else { None };
|
||||
let drag_position = if state.dragging() {
|
||||
drag_position
|
||||
} else {
|
||||
None
|
||||
};
|
||||
Stack::new()
|
||||
.with_child(render_child(state, cx))
|
||||
.with_children(drag_position.map(|drag_position| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue