Skip to main content

Search and Top Navigation

#14945 closed bug (fixed)

Opened April 09, 2016 10:19PM UTC

Closed April 13, 2016 03:08PM UTC

ui.menu blur event ui item returns null

Reported by: afercia Owned by: scottgonzalez
Priority: blocker Milestone: 1.12.0
Component: ui.menu Version: 1.11.3
Keywords: Cc:
Blocked by: Blocking:
Description

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! :)

Attachments (0)
Change History (2)

Changed April 11, 2016 01:22PM UTC by scottgonzalez comment:1

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 :-/

Changed April 13, 2016 03:08PM UTC by scottgonzalez comment:2

owner: → scottgonzalez
resolution: → fixed
status: openclosed

In [changeset:"57f801f1de95ce3731c443d35886fbcda989f3a0" 57f801f]:

#!CommitTicketReference repository="" revision="57f801f1de95ce3731c443d35886fbcda989f3a0"
Menu: Don't reset active element until after triggering  event

This ensures that  actually exists in the  event.

Fixes #14945
Closes gh-1696