Skip to main content

Bug Tracker

Side navigation

#12789 closed bug (cantfix)

Opened October 25, 2012 04:13PM UTC

Closed October 26, 2012 01:31PM UTC

Last modified October 26, 2012 01:39PM UTC

.SELECT() DOES NOT SELECT INPUT CONTENT ON IPHONE BROWSER

Reported by: anonymous Owned by: anonymous
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:
Description

Hi

I'm running Safari and Chrome on Ios 6.0 and this following code doesn't work. It work on normal browser like firefox chrome on PC ...

$("input[id='"+iRow+"_"+"nom_client"+"']","#navgrid").bind('focus',function(){

$(this).select();

});

Attachments (0)
Change History (7)

Changed October 25, 2012 04:31PM UTC by dmethvin comment:1

owner: → anonymous
status: newpending
**doesn't work***

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/. Open the link and click to "Fork" (in the top menu) to get started.

Changed October 25, 2012 04:49PM UTC by barden <barden.q@gmail.com> comment:2

Ok it's done, here the link : http://jsfiddle.net/5AGCb/

Changed October 25, 2012 06:08PM UTC by bblackwood comment:3

This is actually an issue with mobile safari (not sure about chrome), not with jQuery. I filed a bug with Apple a while ago and they responded that it was intended behavior. There is no public version of bugs submitted to Apple (that I know of), but here was the bug submitted and response received:

A page like the following will select the text inside the input on desktop safari on load:

http://jsfiddle.net/fzDHJ/

On mobile safari, nothing happens. Selection is not visibly affected, but neither is an error raised.

Response from Apple:

Engineering has determined that this issue behaves as intended based on the following information:

The selected element in the DOM is indeed updated. But "selecting" something in the sense of showing a cursor and displaying the keyboard requires explicit user interaction on iOS and cannot be done programmatically.

Changed October 25, 2012 06:22PM UTC by dmethvin comment:4

Thanks bblackwood! I just tested this modified test case on Android 2.3.4 (the phone I have handy) and it works correctly. I have incorporated several different events and selection methods to see if it's jQuery doing the dirty or not.

http://jsfiddle.net/5AGCb/4/show

barden, can you run this case and see if any of them select the text? If not this ticket is probably cantfix from our end.

Changed October 26, 2012 07:00AM UTC by barden <barden.q@gmail.com> comment:5

Thanks for your answers. Nothing works... I think there is no solution. Maybe in next version of iOS ?

Changed October 26, 2012 01:31PM UTC by dmethvin comment:6

resolution: → cantfix
status: pendingclosed

Changed October 26, 2012 01:39PM UTC by anonymous comment:7

Replying to [comment:5 barden <barden.q@…>]:

Thanks for your answers. Nothing works... I think there is no solution. Maybe in next version of iOS ?

What I was able to do was use selectionStart and selectionEnd. It's not pretty, but it might get you what you need.

http://jsfiddle.net/5AGCb/5/