Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

dcc.Download doesn't open a file picker dialog on Safari #1012

Open
kamatsuoka opened this issue Mar 13, 2024 · 0 comments
Open

dcc.Download doesn't open a file picker dialog on Safari #1012

kamatsuoka opened this issue Mar 13, 2024 · 0 comments

Comments

@kamatsuoka
Copy link

MacOS Sonoma 14.2.1
Safari 17.2.1

dcc.Download doesn't open a file picker dialog on Safari. Instead, it just downloads the file to the ~/Downloads directory using the supplied filename. Example that works as expected on Chrome:

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

app = Dash(__name__)
app.layout = 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")


if __name__ == "__main__":
    app.run(debug=True)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant