Good afternoon!
I need help. How i can fix height increase dcc.Dropdown
As a result, I need to get this :
(Multi Select #6)
New options in dcc.Dropdown should not increase the height of the selector (and width).
My code :
.Select-value-label {
max-width: 150px;
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
vertical-align: middle;
}
.Select-control {
min-width: 31vw;
max-width: 31vw;
max-height: 12vh;
position: relative;
}
from dash import dcc, html, Input, Output, State, Dash, no_update
import dash_bootstrap_components as dbc
app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP, "styles .css"], suppress_callback_exceptions=True)
app.layout = dcc.Dropdown(
options=[
{'label': 'Option A', 'value': 'A'},
{'label': 'Option B', 'value': 'B'},
{'label': 'Option Really Long 1', 'value': 'C'},
{'label': 'Option Really Long 2', 'value': 'D'},
{'label': 'Option Really Long 3', 'value': 'F'},
{'label': 'Option Really Long 4', 'value': 'G'},
{'label': 'Option Really Long 5', 'value': 'I'},
{'label': 'Option Really Long 6', 'value': 'K'},
{'label': 'Option Really Long 7', 'value': 'P'},
],
optionHeight=40,
maxHeight=300,
multi=True,
style={
'width': '31vw',
'max-width': '31vw',
}
)
if __name__ == '__main__':
app.run_server(debug=True)