tauri
tauri copied to clipboard
Dialog open speed very slow
Discussed in https://github.com/tauri-apps/tauri/discussions/6666
Originally posted by HuakunShen April 8, 2023 I am building an app that requires reading file path.
The tauri dialog open api works but took 2 seconds to open the window, which is unusal comparing to a normal browser.
It doesn't seem to be a problem with the frontend framework. I tried with both nuxt and sveltekit, and both opens slowly.
I have same problem on macOS, invoked from React. In Safari opening file dialog is fast, in Tauri it takes about 2 seconds.
I have same problem on macOS, invoked from React. In Safari opening file dialog is fast, in Tauri it takes about 2 seconds.
I just tried the same app on ubuntu, it opens quickly. On MacOS it's slow. Haven't experimented on Windows yet.
I notice that the first time I use a file dialog in macos safari, it's very slow. The next couple uses are a lot faster, and then the dialog opens very fast. Same goes for macos firefox. When I repeatedly open a file dialog in a tauri app on macos, it stays consistently slow. I wonder if the dialog instance is intended to be reused?
It seems that if you include a title that the dialog opens a lot faster.
open({ directory: true, multiple: false, title: "Select a project", defaultPath: await appDataDir(), })
It seems that if you include a title that the dialog opens a lot faster.
open({ directory: true, multiple: false, title: "Select a project", defaultPath: await appDataDir(), })
This works perfectly for me. Thank you!
Not sure if we want to close this issue because this is kind of like a work around.
I figure an update to a doc somewhere would do the trick of closing! I'm not quite sure where as yet tho
to be honest i'd much rather have a fix for this than a doc update closing this issue. Worst case we'll just have to add a default title (on top of the doc update)?
Having the same issue. The title helps but still slow. I am also getting the CATransaction error with the opendialog call was wondering if these issues are related?
https://github.com/tauri-apps/tauri/issues/6189
It seems that if you include a title that the dialog opens a lot faster.
open({ directory: true, multiple: false, title: "Select a project", defaultPath: await appDataDir(), })
Use this method to fix the problem, but still prompt +[CATransaction synchronize] called within transaction
This works perfectly for me. Thank you!
This works perfectly for me. Thank you!