Skip to content
New issue

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

dialog.SaveDialogOption's defaultPath fails if the file already exists #3091

Closed
OJFord opened this issue Dec 21, 2021 · 2 comments
Closed

dialog.SaveDialogOption's defaultPath fails if the file already exists #3091

OJFord opened this issue Dec 21, 2021 · 2 comments

Comments

@OJFord
Copy link
Contributor

OJFord commented Dec 21, 2021

Describe the bug

The defaultPath given to dialog.save, if it's a filename, only works if it doesn't already exist.

Otherwise, the default filename is blank, and the directory open for selection is the parent of tauri.conf.json, as if it wasn't provided.

To Reproduce

$ touch /tmp/test.txt
dialog.save({
  defaultPath: "/tmp/test.txt",
})

Expected behavior

  • filename is defaulted to test.txt
  • directory is defaulted to /tmp

Screenshots

N/A

Platform and Versions (required):

$ cargo tauri dev
Operating System - Arch Linux, version Unknown X64

Node.js environment
  Node.js - 17.3.0

  @tauri-apps/cli - 1.0.0-beta.10


  @tauri-apps/api - 1.0.0-beta.8

Global packages
  npm - 8.3.0
  pnpm - Not installed
  yarn - 1.22.17

Rust environment
  rustc - 1.56.0
  cargo - 1.56.0

App directory structure
/components
/dist
/src-tauri
/node_modules

App
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("unexpected character '^' while parsing major version number")', src/info.rs:637:45
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Additional context

N/A

Stack Trace

N/A

@lucasfernog
Copy link
Member

lucasfernog commented Dec 23, 2021

Tracking this here: rfd#35

@lucasfernog
Copy link
Member

This was fixed on the RFD end, we'll update it when they release a new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants