Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11112 closed bug (invalid)

Uncaught TypeError: Cannot read property 'disabled' of undefined

Reported by: Rick Waldron Owned by:
Priority: low Milestone: None
Component: event Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by Rick Waldron)

I've been frequently encountering this...

Uncaught TypeError: Cannot read property 'disabled' of undefined

jQuery.event.dispatch (jquery.js:3206)
triggerCustomEvent (jquery.mobile-1.0.js:1006)
(anonymous function) (jquery.mobile-1.0.js:1089)

Line 3206:

if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) {

Change History (6)

comment:1 Changed 11 years ago by Rick Waldron

Component: unfiledevent
Priority: undecidedlow

comment:2 Changed 11 years ago by Rick Waldron

Description: modified (diff)

I'll try to put together a test case, but I'm not sure what causes this yet.

Last edited 11 years ago by Rick Waldron (previous) (diff)

comment:3 Changed 11 years ago by dmethvin

It would be caused if the event.target is undefined, but that shouldn't happen if the event is properly jQuery.event.fix()ed and/or it goes through .trigger(). I thought jQuery Mobile 1.0 specified 1.6.4 anyway?

comment:4 Changed 11 years ago by dmethvin

Resolution: invalid
Status: newclosed

Yes it does require 1.6.4 at the moment, the dev build may work with 1.7.1 though.

http://jquerymobile.com/blog/2011/11/16/announcing-jquery-mobile-1-0/

http://jquerymobile.com/download/

comment:5 in reply to:  3 Changed 11 years ago by Rick Waldron

Replying to dmethvin:

It would be caused if the event.target is undefined, but that shouldn't happen if the event is properly jQuery.event.fix()ed and/or it goes through .trigger(). I thought jQuery Mobile 1.0 specified 1.6.4 anyway?

That much was clear, I was trying to identify "what happens" that leaves the event.target undefined.

comment:6 Changed 11 years ago by dmethvin

In jquery.mobile.event.js:

function triggerCustomEvent( obj, eventType, event ) {
var originalType = event.type;
event.type = eventType;
$.event.handle.call( obj, event );
event.type = originalType;
}

Then later:

triggerCustomEvent( thisObject, "taphold", $.Event( "taphold" ) );

The created Event object doesn't have a target, but there's already a ticket for this bug in Mobile: https://github.com/jquery/jquery-mobile/issues/2569

Note: See TracTickets for help on using tickets.