Keep menus alive for submenu interaction
This commit is contained in:
parent
f5477e30e5
commit
4bb7970234
|
|
@ -515,6 +515,13 @@ impl SubMenu {
|
||||||
content(ui)
|
content(ui)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if let Some(_) = &popup_response {
|
||||||
|
// Keep the submenu alive so `from_id`'s staleness check doesn't close it.
|
||||||
|
// Without this, menus whose content has no further SubMenuButtons never update
|
||||||
|
// `last_visible_pass`, causing the parent to reset `open_item` after ~2 frames.
|
||||||
|
MenuState::mark_shown(ui.ctx(), id);
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(popup_response) = &popup_response {
|
if let Some(popup_response) = &popup_response {
|
||||||
// If no child sub menu is open means we must be the deepest child sub menu.
|
// If no child sub menu is open means we must be the deepest child sub menu.
|
||||||
let is_deepest_submenu = MenuState::is_deepest_open_sub_menu(ui.ctx(), id);
|
let is_deepest_submenu = MenuState::is_deepest_open_sub_menu(ui.ctx(), id);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue