I would like to propose a Feature Request:
Would it be possible to get a method
PopupMenu::dismissMenu() ? That method would dismiss a single popup menu.
I know that there exists a method
PopupMenu::dismissAllActiveMenus(). But that method closes all open popup menus. And I want to only close a very specific popup menu (if its open).
Alternatively, if that’s not possible:
Can we get a method
PopupMenu::isShowing()? It would return true, if this specific popup menu is currently shown to the user.
Maybe you are wondering, why I want these methods.
My use case is that I am loading a large file (several Gigabytes) from disk. I do that in a background thread. But as soon as the item has loaded, I am resetting a certain portion of the UI. That portion contains a popup menu, which should close as well (if its open).
But I do not want to close all popup menus. Because a user could currently work on a different part of the UI, where the popup menus don’t need to be reset after the big file has finished loading. Those popups could continue to live.