#14945 closed bug (fixed)

ui.menu blur event ui item returns null

Reported by: Andrea Fercia Owned by: Scott González
Priority: blocker Milestone: 1.12.0
Component: ui.menu Version: 1.11.3
Keywords: Cc:
Blocked by: Blocking:


Looking at the docs, they state the ui.menu blur event passes the event itself and a ui object containing the currently active menu item. See https://api.jqueryui.com/menu/#event-blur By the way, the code actually returns null for the ui.item. Seems either the docs, but more likely the null value is wrong. I can understand why the active menu item is set to null but maybe the event should be triggered before? FWIW noticed this while working on a new core feature for WordPress 4.5, see https://core.trac.wordpress.org/attachment/ticket/33301/33301.voiceover.diff where we used a workaround. Any feedback more than welcome, thanks! :)

Change History (2)

comment:1 Changed 22 months ago by Scott González

Milestone: none1.12.0
Priority: minorblocker
Status: newopen

Yeah, this is a bug in the code. And a pretty obvious bug looking at the code :-/

comment:2 Changed 22 months ago by Scott González

Owner: set to Scott González
Resolution: fixed
Status: openclosed

In 57f801f:

Menu: Don't reset active element until after triggering blur event

This ensures that ui.item actually exists in the blur event.

Fixes #14945
Closes gh-1696

Note: See TracTickets for help on using tickets.