Geesu
Geesu

Reputation: 6018

Internet Explorer 8+ - Filling select via jquery doesn't widen the select

Basically I autofill the expense description based on what expense category is chosen, and the select won't widen based on the content that is in the box.

Of course this works perfectly fine on chrome, firefox and safari.

Anyone have any ideas as to why it won't auto widen like the other browsers? Or how I can force it to? I don't have the width constrained by CSS.

enter image description here

Thanks in advance!

Upvotes: 0

Views: 115

Answers (1)

Toni Toni Chopper
Toni Toni Chopper

Reputation: 1851

This should fix it for IE8:

select:focus {
   position: relative; /* needed if the parent element has assigned width */
   width: auto;
}

Upvotes: 1

Related Questions