CreativeIT / getmdl-select

Select for material-design-lite
http://creativeit.github.io/getmdl-select/
MIT License
301 stars 87 forks source link

Element is invisible because `i.querySelector('.mdl-menu').clientWidth` gets 0 #19

Closed fmaylinch closed 8 years ago

fmaylinch commented 8 years ago

In getmdl-select.js:34 I get width 0px so elements are not visible.

If I run getmdlSelect.init('.getmdl-select'); again I get a correct width but not what I want, because I want the default 300px of .mdl-textfield (or whatever I would like to set in my CSS).

I would add an option to enable that line, like a new class getmdl-select-autowidth.

Anyway, if you enable that line, it seems that it may get 0px like in my case.

franckevva commented 8 years ago

Now you can add a class getmdl-select__fullwidth and field will be stretched to the full width. The default getmdl value is 300px.