In iOS 8.0, Apple introduced a new bug in Safari on iPhone, which I think is very serious when using multiple <select>
elements. It's commonly used for example to select day of birth. To reproduce:
Create a page with two <select>
with multiple <option>
in each
Open in Safari on iOS 8 on iPhone (The bug still exists in 8.0.2)
Tap the first <select>
Choose the third option i.e. March
Notice that it doesn't update the <select>
to what you chose (it does in iOS 7)
Tap the second <select>
element
Notice the following:
<select>
doesn't update<select>
shows 3 (which is the position of the first <select>
)You can repeat this by alternating between tapping the first and second <select>
, and notice that it changes in the same pattern. This may appear randomly unless you know the pattern). It looks even more confusing if you also have a year-picker.
To try in your mobile device, try this jsfiddle: http://jsfiddle.net/m7baw590/6/embedded/result/
Also, the onchange="alert(this.value)"
reports an incorrect value (the same that is selected on the second <select>
element. You can see this here: http://jsfiddle.net/m7baw590/7/embedded/result/
These bugs does not occur if you click "Done" between each selection, or use the arrows to switch.
Is there any workaround for this?
To select multiple items, drag two fingers over the items you want to select. When the view recognizes the two-finger pan gesture, it changes to edit mode, allowing you to select more than one item. The selected items don't have to be contiguous.
Essentially, what you want to do is press down on a single word in the section of text that you want to select. After second, lift your finger. You will then be able to move the pointers around to select how much or how little of the text you want to select.
iOS provides a single tap "Select All" button only in certain places in the Photos app. For the sections that don't, pressing "Select" at the top-right corner, tapping the last photo, and swiping to the far left and up will select all the images in the folder.
I solved the problem this way:
<select>
<option></option>
<option></option>
<option></option>
(...)
<optgroup disabled></optgroup>
</select>
Just added an empty <optgroup>
to the <select>
.
I discovered another bug with select fields in iOS8 (Only on iPhone, iPad seems fine for example).
http://jsbin.com/kuhogopafe/1
How to reproduce:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With