We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
FileDialogBuilder::set_parent
set_parent does not seem to work on macOS. When it's used, the file dialog should be attached to the window, like in the rfd winit example:
set_parent
#[tauri::command] pub async fn open(win: tauri::Window) -> Result<(), String> { let mut d = tauri::api::dialog::FileDialogBuilder::new().set_parent(&win); let (sender, receiver) = std::sync::mpsc::channel(); d.pick_file(move |p| { sender.send(p).unwrap(); }); let file_path = match receiver.recv().unwrap_or_default() { Some(p) => p, None => return Ok(()), }; println!("file_path {:?}", file_path); Ok(()) }
No response
Operating System - Mac OS, version 10.15.7 X64 Node.js environment Node.js - 16.13.1 @tauri-apps/cli - 1.0.0-beta.10 @tauri-apps/api - 1.0.0-beta.8 Global packages npm - 8.1.2 yarn - 1.22.17 Rust environment rustc - 1.58.0 cargo - 1.58.0 App directory structure /node_modules /public /src-tauri /build /.git /src App tauri.rs - 1.0.0-beta.8 build-type - bundle CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self' distDir - ../build devPath - http://localhost:5000 framework - Svelte
The text was updated successfully, but these errors were encountered:
Seems like it works in rfd for AsyncFileDialog, but not for FileDialog which Tauri uses
AsyncFileDialog
FileDialog
Sorry, something went wrong.
Opened PolyMeilex/rfd#53
Is there any reason why Tauri isn't using AsyncFileDialog?
It kind of looks like you'd need to use AsyncFileDialog to get "sheet" behavior...
or maybe rfd would have to handle the async stuff in some sync wrapper?
The AsyncFileDialog uses https://developer.apple.com/documentation/appkit/nssavepanel/1535870-beginsheetmodalforwindow/ which seems async to me (takes completion handler parameter) ?
feat(core): use rfd::AsyncFileDialog, closes #3312
56efd52
bf89a05
No branches or pull requests
Describe the bug
set_parent
does not seem to work on macOS. When it's used, the file dialog should be attached to the window, like in the rfd winit example:Reproduction
Expected behavior
No response
Platform and versions
Stack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: