dash-core-components icon indicating copy to clipboard operation
dash-core-components copied to clipboard

[BUG] margin-left in dcc.Dropdown does not update the "dropdown"

Open pfbuxton opened this issue 5 years ago • 5 comments

Example:

import dash
import dash_html_components as html
import dash_core_components as dcc

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.layout = html.Div([
    dcc.Dropdown(
        id='my-dropdown',
        options=[
            {'label': 'New York City', 'value': 'NYC'},
            {'label': 'Montreal', 'value': 'MTL'},
            {'label': 'San Francisco', 'value': 'SF'}
        ],
        value='NYC',
        style={ 'width':'400px', 'margin-left':'150px' }
    ),
    html.Div(id='output-container')
])

@app.callback(
    dash.dependencies.Output('output-container', 'children'),
    [dash.dependencies.Input('my-dropdown', 'value')])
def update_output(value):
    return 'You have selected "{}"'.format(value)

if __name__ == '__main__':
    app.run_server(debug=True)

Result: bug

Note, you could put the dcc.Dropdown inside a Div, but this does not always work as you can have the "dropdown" overlapping other interactive elements making them non-interactable.

pfbuxton avatar Nov 08 '19 11:11 pfbuxton

I have the same issue as of 04.14.2020

elavenrac avatar Apr 14 '20 12:04 elavenrac

I also have the same issue as of 10.28.2020

lcalcagni avatar Oct 28 '20 22:10 lcalcagni

Yeah this is still an issue 2/16/2021

nhoover avatar Feb 16 '21 22:02 nhoover

Still an issue as of 21/07/2022

Nic-Nic avatar Jul 21 '22 10:07 Nic-Nic

Use letter 'u' before 'Montréal' or 'Montréal'

HappyZooka avatar Dec 25 '22 07:12 HappyZooka