Skip to content

[FEATURE] automatically set parent dialog with window.dialog().file() #2563

Open
@anatawa12

Description

@anatawa12

To open file dialog correctly linked to window, we have to manually link with set_parent like this:

#[tauri::command]
#[specta::specta]
pub async fn some_command(window: Window) {
    let mut file = window
        .dialog()
        .file()
        .set_parent(&window)
        .blocking_pick_folder();
}

However, I think it's better to link dialog to window by default to reduce mistakes

It may needs some trick on traits and/or breaking changes so I think it may be good to have in v3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions