LeaVerou / stretchy

Form element autosizing, the way it should be
https://stretchy.verou.me/
Other
1.27k stars 87 forks source link

fixes #19, Empty <select> causes Error + Adding Example on test.html … #37

Closed KhaledTouaibia closed 3 years ago

KhaledTouaibia commented 6 years ago

This commit solves #14

element.options[element.selectedIndex].textContent;

element.selectedIndex is -1, therefore this error happens

So i added a condition to check if element.selectedIndex == -1 then do nothing in line 107. I also added an example in test.html page under select section with an empty select tag.

LeaVerou commented 3 years ago

Thanks, merged! Better late than never?