#12789 closed bug (cantfix)
.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();
});
Change History (7)
comment:1 follow-up: 2 Changed 10 years ago by
Owner: | set to anonymous |
---|---|
Status: | new → pending |
comment:3 Changed 10 years ago by
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:
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.
comment:4 Changed 10 years ago by
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.
comment:5 follow-up: 7 Changed 10 years ago by
Thanks for your answers. Nothing works... I think there is no solution. Maybe in next version of iOS ?
comment:6 Changed 10 years ago by
Resolution: | → cantfix |
---|---|
Status: | pending → closed |
comment:7 Changed 10 years ago by
Replying to barden <[email protected]…>:
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.
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.