How to fix truncated text on element on iOS7












24















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:



enter image description here



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.










share|improve this question























  • I think that you can't...

    – grigno
    Oct 16 '13 at 8:12













  • split the options as much u can.

    – Muruganandham K
    Oct 16 '13 at 8:24
















24















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:



enter image description here



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.










share|improve this question























  • I think that you can't...

    – grigno
    Oct 16 '13 at 8:12













  • split the options as much u can.

    – Muruganandham K
    Oct 16 '13 at 8:24














24












24








24


12






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:



enter image description here



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.










share|improve this question














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:



enter image description here



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.







html html5 jquery-mobile ios7 jquery-mobile-select






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 16 '13 at 8:06









LucianLucian

2,09352133




2,09352133













  • I think that you can't...

    – grigno
    Oct 16 '13 at 8:12













  • split the options as much u can.

    – Muruganandham K
    Oct 16 '13 at 8:24



















  • I think that you can't...

    – grigno
    Oct 16 '13 at 8:12













  • split the options as much u can.

    – Muruganandham K
    Oct 16 '13 at 8:24

















I think that you can't...

– grigno
Oct 16 '13 at 8:12







I think that you can't...

– grigno
Oct 16 '13 at 8:12















split the options as much u can.

– Muruganandham K
Oct 16 '13 at 8:24





split the options as much u can.

– Muruganandham K
Oct 16 '13 at 8:24












2 Answers
2






active

oldest

votes


















43














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>





share|improve this answer
























  • it looks a little bit like some dirty hack. But works perfectly!

    – emte
    Jul 15 '14 at 16:04






  • 2





    Jesus, what a weird hack. But as others have said, it works, so shrug.

    – Colm Doyle
    Aug 22 '14 at 8:28











  • take from a NAA of @tmwild Sorry to post this as an answer rather than a comment (new account) but the accepted solution here will currently cause a problem on ios8 devices. Ios8 struggles with optgroups - find the details below... github.com/jquery/jquery-mobile/issues/7848

    – bummi
    Dec 15 '14 at 11:44











  • This works for iOS, any solution for Android?

    – jjsquared
    Jun 30 '15 at 17:06






  • 1





    yes this is the ONLY solution out there for webapps. it's an absolutely absurd hack for a despicable UI but it works and solves numerous client issues. iOS should simply auto size and wrap text. Android, at least HTC Sense does this in a modern popup screen. So over this horrendous wheel thing. </rant> Cheers!

    – JimXC
    Apr 27 '16 at 11:57



















13














Like the answer above, but add an empty optgroup for every select in the document using JS:



// iOS 7 hack: Add an optgroup to every select in order to avoid truncating the content
if (navigator.userAgent.match(/(iPad|iPhone|iPod touch);.*CPU.*OS 7_d/i)) {
var selects = document.querySelectorAll("select");
for (var i = 0; i < selects.length; i++ ){
selects[i].appendChild(document.createElement("optgroup"));
}
}


Hope this comes in handy to someone having the same issue.






share|improve this answer
























  • Thanks, this is working, but the text become not centered

    – AmineG
    Aug 29 '14 at 14:32











  • Thanks. This worked perfect for me IOS 10(current last version) and bellow

    – webicy
    Feb 10 '17 at 11:14



















2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









43














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>





share|improve this answer
























  • it looks a little bit like some dirty hack. But works perfectly!

    – emte
    Jul 15 '14 at 16:04






  • 2





    Jesus, what a weird hack. But as others have said, it works, so shrug.

    – Colm Doyle
    Aug 22 '14 at 8:28











  • take from a NAA of @tmwild Sorry to post this as an answer rather than a comment (new account) but the accepted solution here will currently cause a problem on ios8 devices. Ios8 struggles with optgroups - find the details below... github.com/jquery/jquery-mobile/issues/7848

    – bummi
    Dec 15 '14 at 11:44











  • This works for iOS, any solution for Android?

    – jjsquared
    Jun 30 '15 at 17:06






  • 1





    yes this is the ONLY solution out there for webapps. it's an absolutely absurd hack for a despicable UI but it works and solves numerous client issues. iOS should simply auto size and wrap text. Android, at least HTC Sense does this in a modern popup screen. So over this horrendous wheel thing. </rant> Cheers!

    – JimXC
    Apr 27 '16 at 11:57
















43














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>





share|improve this answer
























  • it looks a little bit like some dirty hack. But works perfectly!

    – emte
    Jul 15 '14 at 16:04






  • 2





    Jesus, what a weird hack. But as others have said, it works, so shrug.

    – Colm Doyle
    Aug 22 '14 at 8:28











  • take from a NAA of @tmwild Sorry to post this as an answer rather than a comment (new account) but the accepted solution here will currently cause a problem on ios8 devices. Ios8 struggles with optgroups - find the details below... github.com/jquery/jquery-mobile/issues/7848

    – bummi
    Dec 15 '14 at 11:44











  • This works for iOS, any solution for Android?

    – jjsquared
    Jun 30 '15 at 17:06






  • 1





    yes this is the ONLY solution out there for webapps. it's an absolutely absurd hack for a despicable UI but it works and solves numerous client issues. iOS should simply auto size and wrap text. Android, at least HTC Sense does this in a modern popup screen. So over this horrendous wheel thing. </rant> Cheers!

    – JimXC
    Apr 27 '16 at 11:57














43












43








43







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>





share|improve this answer













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>






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 1 '13 at 20:00









Doug WilsonDoug Wilson

2,58732430




2,58732430













  • it looks a little bit like some dirty hack. But works perfectly!

    – emte
    Jul 15 '14 at 16:04






  • 2





    Jesus, what a weird hack. But as others have said, it works, so shrug.

    – Colm Doyle
    Aug 22 '14 at 8:28











  • take from a NAA of @tmwild Sorry to post this as an answer rather than a comment (new account) but the accepted solution here will currently cause a problem on ios8 devices. Ios8 struggles with optgroups - find the details below... github.com/jquery/jquery-mobile/issues/7848

    – bummi
    Dec 15 '14 at 11:44











  • This works for iOS, any solution for Android?

    – jjsquared
    Jun 30 '15 at 17:06






  • 1





    yes this is the ONLY solution out there for webapps. it's an absolutely absurd hack for a despicable UI but it works and solves numerous client issues. iOS should simply auto size and wrap text. Android, at least HTC Sense does this in a modern popup screen. So over this horrendous wheel thing. </rant> Cheers!

    – JimXC
    Apr 27 '16 at 11:57



















  • it looks a little bit like some dirty hack. But works perfectly!

    – emte
    Jul 15 '14 at 16:04






  • 2





    Jesus, what a weird hack. But as others have said, it works, so shrug.

    – Colm Doyle
    Aug 22 '14 at 8:28











  • take from a NAA of @tmwild Sorry to post this as an answer rather than a comment (new account) but the accepted solution here will currently cause a problem on ios8 devices. Ios8 struggles with optgroups - find the details below... github.com/jquery/jquery-mobile/issues/7848

    – bummi
    Dec 15 '14 at 11:44











  • This works for iOS, any solution for Android?

    – jjsquared
    Jun 30 '15 at 17:06






  • 1





    yes this is the ONLY solution out there for webapps. it's an absolutely absurd hack for a despicable UI but it works and solves numerous client issues. iOS should simply auto size and wrap text. Android, at least HTC Sense does this in a modern popup screen. So over this horrendous wheel thing. </rant> Cheers!

    – JimXC
    Apr 27 '16 at 11:57

















it looks a little bit like some dirty hack. But works perfectly!

– emte
Jul 15 '14 at 16:04





it looks a little bit like some dirty hack. But works perfectly!

– emte
Jul 15 '14 at 16:04




2




2





Jesus, what a weird hack. But as others have said, it works, so shrug.

– Colm Doyle
Aug 22 '14 at 8:28





Jesus, what a weird hack. But as others have said, it works, so shrug.

– Colm Doyle
Aug 22 '14 at 8:28













take from a NAA of @tmwild Sorry to post this as an answer rather than a comment (new account) but the accepted solution here will currently cause a problem on ios8 devices. Ios8 struggles with optgroups - find the details below... github.com/jquery/jquery-mobile/issues/7848

– bummi
Dec 15 '14 at 11:44





take from a NAA of @tmwild Sorry to post this as an answer rather than a comment (new account) but the accepted solution here will currently cause a problem on ios8 devices. Ios8 struggles with optgroups - find the details below... github.com/jquery/jquery-mobile/issues/7848

– bummi
Dec 15 '14 at 11:44













This works for iOS, any solution for Android?

– jjsquared
Jun 30 '15 at 17:06





This works for iOS, any solution for Android?

– jjsquared
Jun 30 '15 at 17:06




1




1





yes this is the ONLY solution out there for webapps. it's an absolutely absurd hack for a despicable UI but it works and solves numerous client issues. iOS should simply auto size and wrap text. Android, at least HTC Sense does this in a modern popup screen. So over this horrendous wheel thing. </rant> Cheers!

– JimXC
Apr 27 '16 at 11:57





yes this is the ONLY solution out there for webapps. it's an absolutely absurd hack for a despicable UI but it works and solves numerous client issues. iOS should simply auto size and wrap text. Android, at least HTC Sense does this in a modern popup screen. So over this horrendous wheel thing. </rant> Cheers!

– JimXC
Apr 27 '16 at 11:57













13














Like the answer above, but add an empty optgroup for every select in the document using JS:



// iOS 7 hack: Add an optgroup to every select in order to avoid truncating the content
if (navigator.userAgent.match(/(iPad|iPhone|iPod touch);.*CPU.*OS 7_d/i)) {
var selects = document.querySelectorAll("select");
for (var i = 0; i < selects.length; i++ ){
selects[i].appendChild(document.createElement("optgroup"));
}
}


Hope this comes in handy to someone having the same issue.






share|improve this answer
























  • Thanks, this is working, but the text become not centered

    – AmineG
    Aug 29 '14 at 14:32











  • Thanks. This worked perfect for me IOS 10(current last version) and bellow

    – webicy
    Feb 10 '17 at 11:14
















13














Like the answer above, but add an empty optgroup for every select in the document using JS:



// iOS 7 hack: Add an optgroup to every select in order to avoid truncating the content
if (navigator.userAgent.match(/(iPad|iPhone|iPod touch);.*CPU.*OS 7_d/i)) {
var selects = document.querySelectorAll("select");
for (var i = 0; i < selects.length; i++ ){
selects[i].appendChild(document.createElement("optgroup"));
}
}


Hope this comes in handy to someone having the same issue.






share|improve this answer
























  • Thanks, this is working, but the text become not centered

    – AmineG
    Aug 29 '14 at 14:32











  • Thanks. This worked perfect for me IOS 10(current last version) and bellow

    – webicy
    Feb 10 '17 at 11:14














13












13








13







Like the answer above, but add an empty optgroup for every select in the document using JS:



// iOS 7 hack: Add an optgroup to every select in order to avoid truncating the content
if (navigator.userAgent.match(/(iPad|iPhone|iPod touch);.*CPU.*OS 7_d/i)) {
var selects = document.querySelectorAll("select");
for (var i = 0; i < selects.length; i++ ){
selects[i].appendChild(document.createElement("optgroup"));
}
}


Hope this comes in handy to someone having the same issue.






share|improve this answer













Like the answer above, but add an empty optgroup for every select in the document using JS:



// iOS 7 hack: Add an optgroup to every select in order to avoid truncating the content
if (navigator.userAgent.match(/(iPad|iPhone|iPod touch);.*CPU.*OS 7_d/i)) {
var selects = document.querySelectorAll("select");
for (var i = 0; i < selects.length; i++ ){
selects[i].appendChild(document.createElement("optgroup"));
}
}


Hope this comes in handy to someone having the same issue.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 11 '14 at 11:50









Alex PlugaruAlex Plugaru

1,5631222




1,5631222













  • Thanks, this is working, but the text become not centered

    – AmineG
    Aug 29 '14 at 14:32











  • Thanks. This worked perfect for me IOS 10(current last version) and bellow

    – webicy
    Feb 10 '17 at 11:14



















  • Thanks, this is working, but the text become not centered

    – AmineG
    Aug 29 '14 at 14:32











  • Thanks. This worked perfect for me IOS 10(current last version) and bellow

    – webicy
    Feb 10 '17 at 11:14

















Thanks, this is working, but the text become not centered

– AmineG
Aug 29 '14 at 14:32





Thanks, this is working, but the text become not centered

– AmineG
Aug 29 '14 at 14:32













Thanks. This worked perfect for me IOS 10(current last version) and bellow

– webicy
Feb 10 '17 at 11:14





Thanks. This worked perfect for me IOS 10(current last version) and bellow

– webicy
Feb 10 '17 at 11:14



Popular posts from this blog

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)