Skip to main content

Search and Top Navigation

#7070 closed bug (fixed)

Opened March 06, 2011 02:04AM UTC

Closed March 06, 2011 01:52PM UTC

event.originalEvent undefined in overridden focus event

Reported by: JackT Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.autocomplete Version: 1.8.5
Keywords: Cc:
Blocked by: Blocking:

I need to override the autocomplete focus event with a custom action and do something based on whether the user was selecting from the list using the keyboard and not the mouse. To do that I'm checking the originalEvent.type in the event object which is supposed to contain the type of action performed (keydown, keyup, mouseenter, etc).

However, the originalEvent object seems to be undefined. It is working just fine in the actual focus event in the autocomplete code, but not when I override that event inside of the autocomplete object.

Please see my code below.

$( "#tags" ).autocomplete({
    source: availableTags,
    focus: function(event, ui) {
        //Check whether focus was triggered by a mouse or keyboard event
        if ( /^key/.test(event.originalEvent.type) ) {
            //Do something here

        return false;
Attachments (0)
Change History (1)

Changed March 06, 2011 01:52PM UTC by scottgonzalez comment:1

resolution: → fixed
status: newclosed

This was already fixed. In the future please test against the latest version before filing a bug.