Bug Tracker

Ticket #11112 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

Uncaught TypeError: Cannot read property 'disabled' of undefined

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

Description (last modified by rwaldron) (diff)

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

comment:1 Changed 3 years ago by rwaldron

  • Priority changed from undecided to low
  • Component changed from unfiled to event

comment:2 Changed 3 years ago by rwaldron

  • Description modified (diff)

I'm

Version 0, edited 3 years ago by rwaldron (next)

comment:3 follow-up: ↓ 5 Changed 3 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 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

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 3 years ago by rwaldron

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 3 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.