Black Lives Matter. Please consider donating to Black Girls Code today.

dcc.Loading for dcc.Upload

I am having difficulties getting a dcc.Loading to interact with a dcc.Upload. I want the loader to be visible during the duration of downloading the file. Below is my code; I do not see any loading happening. Any feedback is appreciated.

Layout Code:

    dcc.Loading(id='file-loader', type="default", children=[html.Div(
                'Drag and Drop or ',
                html.A('Select Files')
                'width': '800px',
                'height': '50px',
                'lineHeight': '50px',
                'borderWidth': '3px',
                'borderStyle': 'dashed',
                'borderRadius': '5px',
                'textAlign': 'center',
                'margin': '20px',
            # Allow multiple files to be uploaded

@app.callback(Output(“file-loader”, “children”))

Same issue here. I’d be interested to hear if anyone has solved this yet.

I worked around this issue by wrapping the component that was being updated with the uploaded file. In my case, I’m populating a graph with the data, so the graph shows the spinner when the file is uploaded.

You might be able to create a dummy Div somewhere that would give you similar behavior–it may be that the file uploader widget just won’t show the spinner for some reason.