mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-10-05 20:48:58 +03:00
* fix(core/dialog): reconstruct path using appropraite separator, closes #8074 * Update dialog-window-forward-slash.md * Update dialog.rs * Update core/tauri/src/endpoints/dialog.rs --------- Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
This commit is contained in:
parent
9b230de7bc
commit
50a3d170f2
5
.changes/dialog-window-forward-slash.md
Normal file
5
.changes/dialog-window-forward-slash.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'tauri': 'patch:bug'
|
||||
---
|
||||
|
||||
On Windows, fix `open` dialog `defaultPath`, when invoked from JS, not working if the path uses forward slash (`/`)
|
@ -301,6 +301,8 @@ fn set_default_path(
|
||||
mut dialog_builder: FileDialogBuilder,
|
||||
default_path: PathBuf,
|
||||
) -> FileDialogBuilder {
|
||||
// we need to adjust the separator on Windows: https://github.com/tauri-apps/tauri/issues/8074
|
||||
let default_path: PathBuf = default_path.components().collect();
|
||||
if default_path.is_file() || !default_path.exists() {
|
||||
if let (Some(parent), Some(file_name)) = (default_path.parent(), default_path.file_name()) {
|
||||
if parent.components().count() > 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user