如何修复 <select> 上的截断文本iOS7 上的元素 [英] How to fix truncated text on <select> element on iOS7

查看:19
本文介绍了如何修复 <select> 上的截断文本iOS7 上的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 html select 元素上选择选项时,有什么方法可以防止 iOS7 截断文本?iOS7 会截断选项文本上的文本而不是将其换行.在我的特定情况下,这是完全无法使用的:

Is there any way to prevent iOS7 from truncating the text when selecting an option on a html select element? iOS7 truncates the text on the options text instead of wrapping it. In my specific case this is totally unusable:

上面的屏幕截图取自使用 jQuery Mobile 构建的 html 5 应用程序.我还应该提到这个问题在 iOS6 上不存在.

The above screenshot was taken from a html 5 app built with jQuery Mobile. I should also mention that this issue is not present on iOS6.

推荐答案

在选择列表的末尾添加一个空的optgroup:

Add an empty optgroup at the end of the select list:

 <select>
  <option selected="" disabled="">Select a value</option>
  <option>Grumpy wizards make toxic brew for the evil Queen and Jack</option>
  <option>Quirky spud boys can jam after zapping five worthy Polysixes</option>
  <option>The wizard quickly jinxed the gnomes before they vaporized</option>
  <option>All questions asked by five watched experts amaze the judge</option>
  <optgroup label=""></optgroup>
 </select>

这篇关于如何修复 &lt;select&gt; 上的截断文本iOS7 上的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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