Repository: tauri
Issue: [bug] defaultPath of SaveDialogOptions does not work as documented
Labels: type: bug,status: needs triage

### Describe the bug

Documentation about `SaveDialogOptions` passed into `@tauri-apps/api/dialog/save` states
```
Initial directory or file path. If it's a directory path, the dialog interface will change to that folder. 
If it's not an existing directory, the file name will be set to the dialog's file name input and the dialog will be set to the parent folder.
``` 
https://tauri.app/v1/api/js/dialog/#savedialogoptions

On OS X when I'm opening the save dialog with:
1. `defaultPath` pointing to a existing directory => the dialog is opened at that directory, the file name is `Untitled` ✅
2. `defaultPath` pointing to a non-existing file in an existing directory =>  the dialog is opened at the last used directory and the file name is the name as provided by `defaultPath` ❌

Based on the documentation (and my needs) I would expect the directory is respected as well.


### Reproduction

- Setup a tauri app with 
```
"tauri": {
    "macOSPrivateApi": true,
    "allowlist": {
      "all": false,
      "dialog": {
        "open": true,
        "save": true
      },
...
```
- Execute from javascript:
```
import { save } from '@tauri-apps/api/dialog';

save({ title: 'Save File', defaultPath: /Users/me/test1/file1.txt }),
```
where `/Users/me/test1` should be an existing directory (which does not contain `file1.txt`).

### Expected behavior

- FileDialog opens
- The opened directory matches the given directory part of `defaultPath`
- The file name matches the given file name part of `defaultPath`

### Platform and versions

```text
[✔] Environment
    - OS: Mac OS 13.5.2 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.68.2 (9eb3afe9e 2023-03-27)
    ✔ cargo: 1.68.2 (6feb7c9cf 2023-03-26)
    ✔ rustup: 1.25.2 (17db695f1 2023-02-01)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 18.17.1
    - yarn: 1.22.19
    - npm: 9.6.7

[-] Packages
    - tauri [RUST]: 1.5.2
    - tauri-build [RUST]: 1.5.0
    - wry [RUST]: 0.24.4
    - tao [RUST]: 0.16.5
    - cargo-tauri [RUST]: 1.0.0-beta.7
    - @tauri-apps/api [NPM]: 1.5.1
    - @tauri-apps/cli [NPM]: 1.5.6

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:5173/
    - framework: Svelte
    - bundler: Vite

----

Operating System - Mac OS, version 13.5.2 X64

Node.js environment
  Node.js - 18.17.1
  @tauri-apps/cli - 1.0.0-beta.10 (outdated, latest: 1.5.6)
  @tauri-apps/api - 1.5.1

Global packages
  npm - 9.6.7
  pnpm - Not installed
  yarn - 1.22.19

Rust environment
  rustc - 1.68.2
  cargo - 1.68.2

Rust environment
  rustup - 1.25.2
  rustc - 1.68.2
  cargo - 1.68.2
  toolchain - stable-aarch64-apple-darwin (environment override by RUSTUP_TOOLCHAIN)

App directory structure
/.husky
/dist
/node_modules
/public
/src-tauri
/.git
/.vscode
/src

App
  tauri.rs - 1.5.2
  build-type - bundle
  CSP - unset
  distDir - ../dist
  devPath - http://localhost:5173/
  framework - Svelte
```


### Stack trace

_No response_

### Additional context

_No response_