3

I must be doing something very stupid.

Whatever I tried I always get an empty select.

This is the code:

   <select>
       <option disabled="">jknjk</option>                     
       <option selected value="local"> Со склаа</option>                           
       <option value="preorder"> Предзаказ</option>    
    </select>

enter image description here

I swear I used select elements before and never had problems with it. But I have no ideas why it works so in this case when it shouldn't.

If I click it one time after loadiing - it can be used. As one can see it has selected value (in inspector)

Could it be some CSS what makes it behave so?

Full image

Full css styles attached to select element

Tebe
  • 3,176
  • 8
  • 40
  • 60
  • 6
    Must be your CSS, works fine: http://jsfiddle.net/qyej6j4m/. Looking at the display it looks like you're using a dropdown plugin. Do you populate the select after the plugin is called? – Mathew Thompson Jun 25 '15 at 08:21
  • What about styles assigned to `select>option` ? – Arthur Halma Jun 25 '15 at 08:23
  • I think it's because you haven't closed a tag above. Your input tags perhaps. Try putting at the top. – trees_are_great Jun 25 '15 at 08:23
  • Looking at the CSS, it is *not* a select replacement. Besides, it rather looks like a native control, not like a plugin. – connexo Jun 25 '15 at 08:25
  • 2
    @Sam: Input tags don't need to be closed in HTML5. – Asgaros Jun 25 '15 at 08:25
  • Good point, just checked that. Perhaps another unclosed tag. – trees_are_great Jun 25 '15 at 08:27
  • Not sure how relevant this may be, however try temporarily removing all bootstrap includes. I've heard of cases where, if you have multiple bootstrap includes certain aspects will not work. For example, if you have bootstrap.js, you should not add bootstrap-dropdown.js. – jaunt Jun 25 '15 at 08:33
  • Do you have a fiddle or complete code so we can examine it? A screenshot and some random CSS is not helpful. – Jason Jun 25 '15 at 16:44
  • It works here: http://codepen.io/anon/pen/QbaLKy – Spade Jun 26 '15 at 03:07

1 Answers1

3

This appears to be a Chrome bug, discussed on this question and this question. A work-around solution is to apparently set 'autocomplete="off"' on the form. Perhaps keep an eye on the status of the bug report that was filed in the second link, to see the bug fixed or find a permanent solution.

Community
  • 1
  • 1
Dane Rossenrode
  • 188
  • 1
  • 7