Bug Tracker

Ticket #5677 (closed bug: patchwelcome)

Opened 5 years ago

Last modified 19 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 4 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 4 years ago by SlexAxton

  • Owner changed from brandon to maxogden
  • Priority changed from minor to low
  • Status changed from new to pending
  • Milestone changed from 1.4 to 1.5

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 4 years ago by maxogden

  • Status changed from pending to new

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 4 years ago by SlexAxton

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

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 4 years ago by evilmoe@…

I still have the Problem with Jquery 1.5

comment:6 Changed 4 years ago by Joe iEntry

I have same issue with jQuery 1.5 as well.

comment:7 follow-up: ↓ 8 Changed 3 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 ; follow-up: ↓ 11 Changed 3 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 3 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 3 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 ; follow-up: ↓ 12 Changed 2 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 22 months 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 19 months ago by John Weis

cursor:pointer worked for me!

Thanks!

Note: See TracTickets for help on using tickets.