iOS 7 在 html option s 中不显示多于一行:

<select>
  <option value="volvo">Volvo test test test test test test </option>
  <option value="saab">Saab</option>
  <option value="opel">Opel</option>
  <option value="audi">Audi</option>
</select>

它只是用省略号截断它。有没有其他人通过标准的 HTML option 注意到这一点?

也许这是一个 iOS 7 错误,因为它没有发生在 iOS6 上?我直接从 the w3schools site 中提取了这个。

要重现,请使用运行 iOS 7 的 iPhone 并转到 to this jsFiddle

显然,您可以在选择后看到问题。但是对于移动优化的手机,您将看不到整个问题。

除非我在这里遗漏了什么。

最佳答案

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

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

关于html - iOS 7 doesn't show more than one line when option is longer than screen size,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19011978/

10-12 00:18
查看更多