Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dropdown pops open when dragging onto upload component #318

Open
mungojam opened this issue Oct 4, 2018 · 3 comments
Open

dropdown pops open when dragging onto upload component #318

mungojam opened this issue Oct 4, 2018 · 3 comments
Labels
dash-type-bug Something isn't working as intended

Comments

@mungojam
Copy link

mungojam commented Oct 4, 2018

MRE now below, but here is the general idea:

  1. Create a dash app with a dropdown and an upload component
  2. Run it, and select something from the dropdown, but don't then click anywhere else
  3. Drag a file onto the upload area, and before you let go of the mouse button, the dropdown pops open again

I think it's because the dropdown still has the focus. It doesn't happen if you click elsewhere after originally selecting from the dropdown.

@valentijnnieman
Copy link
Contributor

Interesting, thanks for reporting. Would like to see that MRE when you have it. We're using react-virtualized-select under the hood for the dropdown, for future reference!

@mungojam
Copy link
Author

mungojam commented Oct 5, 2018

image

The cursor doesn't show up right on the recording but I dragged the file straight across to the upload area and only when I let go did the dropdown appear (I think another time it was as soon as I dragged it over the box)

import dash
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash()

app.layout = html.Div(children=[
    dcc.Dropdown(
        id='my-dropdown',
        options=[
            {'label': 'New York City', 'value': 'NYC'},
            {'label': 'Montreal', 'value': 'MTL'},
            {'label': 'San Francisco', 'value': 'SF'}
        ],
        value='NYC'
    ),
    dcc.Upload(
        id='upload-data',
        children=html.Div('Drag and Drop'),
        style={
            'width': '100%',
            'height': '60px',
            'lineHeight': '60px',
            'borderWidth': '1px',
            'borderStyle': 'dashed',
            'borderRadius': '5px',
            'textAlign': 'center',
            'margin': '10px'
        }
    )
])

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

@valentijnnieman valentijnnieman added the dash-type-bug Something isn't working as intended label Oct 9, 2018
@valentijnnieman
Copy link
Contributor

Seeing this behaviour too, thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dash-type-bug Something isn't working as intended
Projects
Development

No branches or pull requests

2 participants