In iOS on an iPhone it is possible to select a disabled option within the picker if the options contain an optgroup. For example, an HTML select with the following code will allow the user to select any disabled option within the list of options: <select> <option>one</option> <option disabled>two</option> <optgroup label="group two"> <option>three</option> <option disabled>four</option> </optgroup> </select> Options "two" and "four," though marked disabled, can be selected and will appear as chosen within the pop-up button when it collapses. VoiceOver does not report the disabled options as dimmed (though they style visually as dimmed). This issue does not affect iPad. Only iPhone's picker manifests the issue.
<rdar://problem/55018179>
Created attachment 407321 [details] Patch
Comment on attachment 407321 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407321&action=review > Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm:289 > + [[view titleLabel] setTextColor:[UIColor colorWithWhite:0.0 alpha:(item.isGroup) ? GroupOptionTextColorAlpha : DisabledOptionAlpha]]; Nit - I think it's a little cleaner without parentheses around item.isGroup here. > LayoutTests/fast/forms/ios/disabled-options-in-multi-select-picker.html:53 > + if (!selectElement.multiple) { Nit - we usually avoid braces around single-line if statements, even in JavaScript. > LayoutTests/fast/forms/ios/disabled-options-in-multi-select-picker.html:61 > + for (i = 0; i < element.getElementsByTagName("*").length; i++) { (Ditto)
Created attachment 407324 [details] Patch for landing
Committed r266194: <https://trac.webkit.org/changeset/266194> All reviewed patches have been landed. Closing bug and clearing flags on attachment 407324 [details].
*** Bug 219536 has been marked as a duplicate of this bug. ***