Reputation: 415
When the focus is in the <input>
and I click on the <select>
dropdown then the dropdown's width is increased.
I tried to set the width on focus to 100%, but that's not working.
This is my html:
<html>
<body>
<select>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
<input type="text" placeholder="hello" />
</body>
</html>
Upvotes: 4
Views: 1352
Reputation: 261
Add the onmousedown attribute and have it focus on the select dropdown so that it loses focus from the input box. For some reason focus on the input before accessing that select causes this error.
<select onmousedown="$(this).focus()">
Upvotes: 5