#[resolved] tauri-plugin-dialog v2: UI Freeze when using "open" using typescript

17 messages · Page 1 of 1 (latest)

halcyon violet
#

Hello Here,
I would like to use the tauri v2 alpha for my new hobbiest application. I'm using Archlinux as development OS.
When I try to use the open fn dialog on Typescript side the UI freeze. I see that it should be fixed on linux (https://github.com/tauri-apps/plugins-workspace/issues/571) but I'm still experiencing this issue.
I'm on the last version of the alpha package of both Tauri and plugin Dialog. I have tried to open the Dialog using Rust (https://github.com/tauri-apps/plugins-workspace/issues/571#issuecomment-1689803877) But it freeze the UI too.
Do i need to add anything in the configuration file to use Dialog plugin ? maybe a permission ?
Thanks for your help

GitHub

Hello, I'm building the official API example on my Windows machine with following commands: git clone git@github.com:tauri-apps/plugins-workspace.git && cd plugins-workspace/examples/ap...

rose rampart
#

When using Rust, are you using the blocking dialog API?

halcyon violet
#

I have used this code:

use rfd::{FileDialog};

#[command]
pub fn open_folder() -> String {
let folder = FileDialog::new().pick_folder();
let folder = folder.unwrap_or_default();
String::from(folder.to_str().unwrap_or_default())
}
rose rampart
#

Ah, so not Tauri's API anymore.

halcyon violet
#

Oh that right, I take the code explain in the github issue and didn't remarke I will test with the Tauri Rust Dialog API.

rose rampart
#

Technically Tauri also uses the rfd crate in that comment.

#
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
rfd = { version = "=0.12.0", features = [ "gtk3", "common-controls-v6" ] }
#

Basically all the desktop targets.

#

But if it's the underlying crate freezing the GUI, I wonder if there's much Tauri can do about it other than raise the issue with the rfd maintainers.

halcyon violet
#

I cant test right now, I will test and make a issue raise an issue with the rfd maintainers if I can reproduce the problem with only rfd

#

Thank for your help

halcyon violet
rose rampart
#

It looks like both Tauri v1.3.0 and Tauri v1.5.3 (latest) use the same version and feature flags for rfd. Maybe something about the implementation changed.

#

Neither version of tauri has a Cargo.lock file so in theory they should be using the same version of rfd.

halcyon violet
#

So after investigation using the npm run tauri add dialog directly insteed of adding it to the cargo.toml manually make dialog open working as expected.
I have migrated from tauri 1.5 to 2.0 alpha I think I have miss setup something during the migration. Now everything works well.

#

[resolved] tauri-plugin-dialog v2: UI Freeze when using "open" using typescript

rose rampart
#

Since you've changed the title to [resolved], I'll go ahead and mark this as solved with /thread solve. If you need to re-open this for any reason, you can use /thread reopen.