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

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

问题描述

如果在当前的 (iOS 9.2) 移动 Safari 中发现一个非常烦人的错误(自 iOS 7 以来首次出现!)

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

如果您在移动 Safari 中使用多选字段 - 像这样:

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>

自动选择会出现问题!

iOS 会在您打开选择后自动选择第一个选项(无需任何用户交互) - 但它不会通过蓝色选择检查"显示给您.

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)...

如果您现在关闭并再次打开选择,iOS 将自动取消选择第一个值 - 如果您重复,它将在没有任何用户交互的情况下再次选择.

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!

推荐答案

safari multi select bug 和EmptyDisabled 选项勾选相关问题的解决方案:

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天全站免登陆