Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 697
isaac weathers Avatar asked Dec 20 '22 23:12

isaac weathers


1 Answers

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>
like image 156
Doug Wilson Avatar answered Jan 11 '23 09:01

Doug Wilson