移动Safari多选错误 [英] Mobile Safari multi select bug

查看:121
本文介绍了移动Safari多选错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果在手机Safari浏览器中使用多个选择字段(如果您在iOS 9上使用多选字段) - 像这样:
$ b

 < select multiple> 
< option value =test1> Test 1< / option>
< option value =test2>测试2< / option>
< option value =test3> Test 3< / option>
< / select>

您将在自动选择时遇到问题!



在你打开select之后,iOS会自动选择第一个选项(没有任何用户交互),但它不会用蓝色选择check显示给你。



<因此,如果你现在选择第二个选项,选择将告诉你,选择了两个选项(但只选中一个作为选择)...



如果你现在关闭并再次打开选择,iOS会自动取消选择第一个值 - 如果您重复,它将被重新选择,而无需任何用户交互。



这是一个非常烦人的系统错误,这是打破用户体验!

解决方案

Safari浏览器多选错误和禁用选项打勾相关问题:

选项值=0>全部< / option><选项值=1>测试1< / option><选项值=2>测试2< / option>< 3>测试3< / option>< option value =4>测试4< / option>< / select>



在实际选项之前添加一个禁用和隐藏的optgroup。


If found a really annoying bug on the current (iOS 9.2) mobile safari (first appearing since iOS 7!)

If you using multi select fields on mobile safari - like this:

<select multiple>
    <option value="test1">Test 1</option>
    <option value="test2">Test 2</option>
    <option value="test3">Test 3</option>
</select>

You will have problems with automatically selection!

iOS is automatically selecting the first option after you opened the select (without any user interaction) - but it will not show it to you with the blue select "check".

So if you now select the second option, the select will tell you that two options are selected (but only highlighting one as selected)...

If you now close and open the select again, iOS will automatically deselect the first value - if you repeat, it will be selected again without any user interaction.

Thats a really annoying system bug, which is breaking the user experience!

解决方案

Solution for safari multi select bug and Empty and Disabled option tick related issue:

<select multiple>
<optgroup disabled hidden></optgroup>
<option value="0">All</option>
<option value="1">Test 1</option>
<option value="2">Test 2</option>
<option value="3">Test 3</option>
<option value="4">Test 4</option>
</select>

Add a disabled and hidden optgroup before the real options.

这篇关于移动Safari多选错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆