Skip to main content

Bug Tracker

Side navigation

#5677 closed bug (patchwelcome)

Opened December 18, 2009 06:28PM UTC

Closed November 10, 2010 07:50PM UTC

Last modified May 06, 2013 04:03PM UTC

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.

Attachments (0)
Change History (13)

Changed November 06, 2010 12:02PM UTC by anonymous comment:1

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/

Changed November 10, 2010 04:42PM UTC by SlexAxton comment:2

milestone: 1.41.5
owner: brandonmaxogden
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?

Changed November 10, 2010 05:36PM UTC by maxogden comment:3

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

Changed November 10, 2010 07:50PM UTC by SlexAxton comment:4

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/

Changed February 24, 2011 01:05PM UTC by evilmoe@bossmail.de comment:5

I still have the Problem with Jquery 1.5

Changed March 16, 2011 09:23PM UTC by Joe iEntry comment:6

I have same issue with jQuery 1.5 as well.

Changed November 18, 2011 04:47PM UTC by Matt comment:7

Quick fix:

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

Changed December 01, 2011 10:12PM UTC by anonymous comment:8

Replying to [comment:7 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.

Changed March 22, 2012 01:06PM UTC by andrewmoorewatson@gmail.com comment:9

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?

Changed March 23, 2012 02:48PM UTC by dmethvin comment:10

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

Changed August 17, 2012 08:24AM UTC by anonymous comment:11

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

Replying to [comment:7 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.

Changed February 07, 2013 03:28PM UTC by Donny comment:12

Replying to [comment:11 anonymous]:

I tried it ,it's awsome.who knows why?Replying to [comment:8 anonymous]: > Replying to [comment:7 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 :)

Changed May 06, 2013 04:03PM UTC by John Weis comment:13

cursor:pointer worked for me!

Thanks!