Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

dcc.Dropdown options height auto adjust

$
0
0

Hello there,

I’m aware that it is possible to configure dcc.Dropdown options height, such as in the code above, which sets the options height to 100 pixels:

dcc.Dropdown(id='company', 
             placeholder = 'Select company',
             options=[{'label':k, 'value':k} for k in companies_list],
             optionHeight=100)

However, in a list of option labels with several different character lengths, it would be great to have the option height set based on the length of each option itself. In other words, I would like to do the following:

dcc.Dropdown(id='company', 
             placeholder = 'Select company',
             options=[{'label':k, 'value':k} for k in companies_list],
             optionHeight='auto')

Is it possible? If so, how to do it?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles