Materialize: Dropdown Width

Created on 15 Dec 2014  路  6Comments  路  Source: Dogfalo/materialize

The dropdown feature should try to adjust it's width with the largest text inside:

Current Release:
http://i.gyazo.com/5a651b4140790f6870a6dc26a3996609.png

What it should look like:
http://i.gyazo.com/f9918f592fff2cd421223f16d3d7dc5c.png

Most helpful comment

Still not working in march 2018

All 6 comments

Please note that I've alredy found a solution:

style='width: auto !important;'

I'll make this into an option, but leave the other as default I think. Since Material design likes to have their dropdown matching width a lot of the times.

Added in 91985119ac10cce516ce5f28f10006748ebf17da

2017: constrainWidth is now passed as an object option/property upon jquery initialization of the dropdown. Check http://materializecss.com/dropdown.html !

sample (with hover, lol):

$(".dropdown-button").dropdown({ hover: true, constrainWidth: false });

Still not working in march 2018

@adhavalboy
If you go into materializecss.js and go to line 2199 you can change the default from true.

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ruslandzhumaev picture ruslandzhumaev  路  3Comments

heshamelmasry77 picture heshamelmasry77  路  3Comments

serkandurusoy picture serkandurusoy  路  3Comments

locomain picture locomain  路  3Comments

ReiiYuki picture ReiiYuki  路  3Comments