iOS 7 doesn't show more than one line when option is longer than screen size

StackOverflow https://stackoverflow.com/questions/19011978

  •  29-06-2022
  •  | 
  •  

Вопрос

iOS 7 does not show more than one line in html options:

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

It just truncates it with ellipsis. Has anyone else noticed this with just a standard HTML option?

Perhaps it is an iOS 7 bug because it was not happening on iOS6? I pulled this directly from the w3schools site.

To reproduce, take your iPhone running iOS 7 and go to this jsFiddle.

Obviously you can see the question once selected. But with a mobile optimized phone you will not see the entire question.

Unless I am missing something here.

Это было полезно?

Решение 2

Looks like it now requires the <optgroup> standard to wrap the options.

Problem solved.

Другие советы

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>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top