fix(menu-bar): exit early from popup creation if no root is hovered
This commit is contained in:
parent
92ec78ba29
commit
7f2d34ead4
2 changed files with 6 additions and 5 deletions
|
|
@ -375,13 +375,14 @@ where
|
|||
let hovered_root = layout
|
||||
.children()
|
||||
.position(|lo| view_cursor.is_over(lo.bounds()));
|
||||
|
||||
if old_active_root
|
||||
.zip(hovered_root)
|
||||
.is_some_and(|r| r.0 == r.1)
|
||||
if hovered_root.is_none()
|
||||
|| old_active_root
|
||||
.zip(hovered_root)
|
||||
.is_some_and(|r| r.0 == r.1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
let (id, root_list) = my_state.inner.with_data_mut(|state| {
|
||||
if let Some(id) = state.popup_id.get(&self.window_id).copied() {
|
||||
// close existing popups
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue