Closed garnold closed 8 years ago
@garnold I caught your problem. This is because initially runs mdl script, then ours. By this time the second tab display: none
, which is why select not be drawn. Now your problem is solved, but the width of the element will be constant.
You can define the width with dynamic initialization like this getmdlSelect.init('#mySelect', 500);
, where '500' is your width.
Works like a charm, thanks @franckevva !
We are using the getmdl-select component within tab panels. If the component is contained within the active tab panel on page load, all is well. However, if the component is contained within an inactive tab panel, the width of the component is 0px.
Interestingly enough, if I remove the
defer
attribute from the script element, the component works as expected in both active and inactive tab panels.Example HTML attached.
getmdl-select-tabs.html.txt