We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 34a5c9e commit 5190e75Copy full SHA for 5190e75
haxe/ui/containers/menus/Menu.hx
@@ -175,7 +175,15 @@ class MenuEvents extends haxe.ui.events.Events {
175
var event = new MenuEvent(MenuEvent.MENU_SELECTED);
176
event.menu = _menu;
177
event.menuItem = item;
178
+ // we'll add a delay of 100ms here because it "feels nicer" for the menu to
179
+ // not just instantly disappear - especially in the case of checkbox menu items
180
Timer.delay(function() {
181
+ // however, its possible that by the time that timer has ticked the menu
182
+ // has already been destroyed by other means, so lets just make sure
183
+ // that isnt the case
184
+ if (@:privateAccess _menu._destroyed) {
185
+ return;
186
+ }
187
findRootMenu().dispatch(event);
188
189
if (_menu.menuBar == null) {
0 commit comments