mirror of
https://github.com/bevyengine/bevy
synced 2024-09-20 22:42:08 +00:00
Fix clicked UI nodes getting reset when hovering child nodes (#4194)
# Objective Fixes #4193 ## Solution When resetting a node's `Interaction` to `None`, ignore any `Clicked` node because that should be handled by the mouse release check exclusively.
This commit is contained in:
parent
21a875d67b
commit
6f16580b8a
1 changed files with 2 additions and 1 deletions
|
@ -169,7 +169,8 @@ pub fn ui_focus_system(
|
||||||
// reset lower nodes to None
|
// reset lower nodes to None
|
||||||
for (_entity, _focus_policy, interaction, _) in moused_over_z_sorted_nodes {
|
for (_entity, _focus_policy, interaction, _) in moused_over_z_sorted_nodes {
|
||||||
if let Some(mut interaction) = interaction {
|
if let Some(mut interaction) = interaction {
|
||||||
if *interaction != Interaction::None {
|
// don't reset clicked nodes because they're handled separately
|
||||||
|
if *interaction != Interaction::Clicked && *interaction != Interaction::None {
|
||||||
*interaction = Interaction::None;
|
*interaction = Interaction::None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue