Bug Tracker

Modify

Ticket #9244 (closed bug: invalid)

Opened 2 years ago

Last modified 12 months ago

.select() does not select input content on iPhone Safari

Reported by: duynguyen0511@… Owned by: duynguyen0511@…
Priority: undecided Milestone: 1.next
Component: selector Version: 1.6
Keywords: Cc:
Blocking: Blocked by:

Description

I am running Safari on iOS 4.3.1

.select() event does not select on Tap/click input field. The same code works on normal browser (Chrome v11.0.696.65, Safari v5.0.5, FF v4.0.1)

Example: <script> $('input').click(function() {

$(this).focus(); $(this).select();

}); </script>

<input type="text" name="amount" id="amount" value="" />

Change History

comment:1 Changed 2 years ago by anonymous

comment:2 Changed 2 years ago by rwaldron

  • Owner set to duynguyen0511@…
  • Status changed from new to pending
  • Component changed from unfiled to selector

Can you send me an iPhone to test this?

What happens when you bind("tap", fn)?

Last edited 2 years ago by rwaldron (previous) (diff)

comment:3 Changed 2 years ago by trac-o-bot

  • Status changed from pending to closed
  • Resolution set to invalid

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

comment:4 Changed 18 months ago by anonymous

This is still a bug!

comment:5 Changed 12 months ago by anonymous

FWIW this appears to be a "feature" of mobile Safari. The workaround is to manually specify the range ala:

setSelectionRange(0, 9999);

Answer from here:

 http://stackoverflow.com/questions/3272089/programmatically-selecting-text-in-an-input-field-on-ios-devices-mobile-safari

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.