Bug Tracker

Opened 14 years ago

Closed 13 years ago

Last modified 10 years ago

#5677 closed bug (patchwelcome)

Live click events don't register on MobileSafari (iPhone)

Reported by: maxogden Owned by: maxogden
Priority: low Milestone: 1.5
Component: event Version: 1.4a1
Keywords: iphone, mobilesafari, live Cc:
Blocked by: Blocking:

Description

See gist: http://gist.github.com/259656

This was tested on a 2G iPhone running software v3.1.2.

I was able to reproduce the bug in 1.4a1 and 1.3.2.

Change History (13)

comment:1 Changed 13 years ago by anonymous

The workaround is to add onclick="" to the element you are attaching the event to per http://www.greaterscope.com/blog/2010/09/15/jquerys-live-click-handler-on-mobile-safari/

comment:2 Changed 13 years ago by SlexAxton

Milestone: 1.41.5
Owner: changed from brandon to maxogden
Priority: minorlow
Status: newpending

That work around is not a valid replacement for a live handler. It's very different, and somewhat obtrusive.

Is this still an issue with 1.4.4pre?

comment:3 Changed 13 years ago by maxogden

Status: pendingnew

seems to still be a problem with the current git version. I upgraded the test case to use http://code.jquery.com/jquery-git.js, and it still works on desktop browsers, but fails to register 'live click' on mobilesafari: http://bl.ocks.org/259656

comment:4 Changed 13 years ago by SlexAxton

Resolution: patchwelcome
Status: newclosed

Technically, click events don't exist on touch devices. You may have more luck by adding in support for touch events. However, it's half support for firing both a touch and a click event seems like this could eventually work. I'd say that filing this to the jquery mobile team would be the quickest way to get this fixed since jQuery doesn't officially support safari mobile, but jquery mobile does.

http://jquerymobile.com/contribute/

comment:5 Changed 13 years ago by evilmoe@…

I still have the Problem with Jquery 1.5

comment:6 Changed 13 years ago by Joe iEntry

I have same issue with jQuery 1.5 as well.

comment:7 Changed 12 years ago by Matt

Quick fix:

Just add "cursor: pointer" to the element's CSS and the live click event will work as expected.

comment:8 in reply to:  7 ; Changed 12 years ago by anonymous

Replying to Matt:

Quick fix:

Just add "cursor: pointer" to the element's CSS and the live click event will work as expected.

I can vouch for this. What an odd workaround for a frustrating problem.

comment:9 Changed 12 years ago by andrewmoorewatson@…

So does this mean that this has been fixed in the next release of jQuery or was it just closed as in "will never be fixed" connotation?

comment:10 Changed 12 years ago by dmethvin

@andrewmoorewatson, it means that this is not something jQuery can fix transparently. The click event does not occur at the document level if the element is not natively clickable, so we cannot process it. You'll need to use one of the solutions outlined here or elsewhere and accept their drawbacks.

comment:11 in reply to:  8 ; Changed 11 years ago by anonymous

I tried it ,it's awsome.who knows why?Replying to anonymous:

Replying to Matt:

Quick fix:

Just add "cursor: pointer" to the element's CSS and the live click event will work as expected.

I can vouch for this. What an odd workaround for a frustrating problem.

comment:12 in reply to:  11 Changed 11 years ago by Donny

Replying to anonymous:

I tried it ,it's awsome.who knows why?Replying to anonymous:

Replying to Matt:

Quick fix:

Just add "cursor: pointer" to the element's CSS and the live click event will work as expected.

I can vouch for this. What an odd workaround for a frustrating problem.

Yup worked for me too :)

comment:13 Changed 10 years ago by John Weis

cursor:pointer worked for me!

Thanks!

Note: See TracTickets for help on using tickets.