dcc.Upload doesn't open save to file window

Hello everyone,
I’m trying dcc.Upload in my app and have an issue with naming a file I want to save on local disc.

When testing I copied code from documentation (btw. great work about Dash/Plotly documentation - thanks!) as separate .py file into my app structure, and run it, everything works as expected

(same as shown on:

  • first example).

Namely, when I click “Download Text” button ‘save to file’ window opens, with pre-selected name, and I can save the file under suggested name or change it to anything I like.

But.
When I use the same code in multipage app. After clicking “Download Text” button a file is saved right away without giving me a chance to adjust filename.

This is not a big deal, just before starting on workaround, I’d like to make sure that I’m not missing smth.

I’m on Linux and PyCharm.
Not sure if this is necessary but here is the code I test Upload with.
Just attach it to any multipage application in ‘pages’ folder.


from dash import dcc, html, Input, Output, callback
import dash

dash.register_page(__name__, title='BBB', name='CCCC', )

def layout():

    return html.Div([
        html.Button("Download Text", id="btn-download-txt"),
        dcc.Download(id="download-text")
])


@callback(
    Output("download-text", "data"),
    Input("btn-download-txt", "n_clicks"),
    prevent_initial_call=True,
)
def func(n_clicks):
    return dict(content="Hello world!", filename="hello.txt")