tauri-apps / tauri-apps/plugins-workspace

[dialog] [iOS] Dialog opens on most recently created window instead of the calling window (multi-scene apps)

Open
#3,485 8 comments 0 reactions 0 assignees View on GitHub
platform: ios plugin: dialog type: bug
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

### Describe the bug

In a multi-window iOS app with multiple scene (`UIScene`) support enabled, dialogs opened via the dialog plugin are always presented on the most recently created window, regardless of which window invoked the command.

If window A is open, then window B is created, and the user triggers a dialog from window A, the dialog appears over window B instead. When B is the frontmost/key scene, dialogs meant for A show up in the wrong scene and are effectively unusable.

### Reproduction

Steps to reproduce:
1. Enable iOS multi-window (UIScene) support and handle `RunEvent::SceneRequested`
2. Create additional windows (per the Tauri mobile multi-window guide).
3. Open the app on iPad so two windows/scenes are visible. From the first window, call any dialog API:

```ts
import { message } from '@tauri-apps/plugin-dialog'
await message('Hello from window A', { title: 'Window A' })
```

4. Observe that the dialog is presented over the second (most recently created) window rather than window A.

### Expected behavior

The dialog should be presented from the window/scene that invoked the command. The plugin command already carries the originating webview label, so presentation should be anchored to that window's `UIWindowScene` / root view controller rather than the current key window or foreground scene.

### Full `tauri info` output

```text
[✔] Environment
- OS: Mac OS 26.5.2 arm64 (X64)
✔ Xcode Command Line Tools: installed
✔ Xcode: 26.6
✔ rustc: 1.94.0 (4a4ef493e 2026-03-02)
✔ cargo: 1.94.0 (85eff7c80 2026-01-15)
✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
✔ Rust toolchain: 1.94.0-aarch64-apple-darwin
- node: 24.13.1
- npm: 11.8.0
- bun: 1.3.12

[-] Packages
- tauri 🦀: 2.11.3, (outdated, latest: 2.11.5)
- tauri-build 🦀: 2.6.3
- wry 🦀: 0.55.1
- tao 🦀: 0.35.3
- tauri-cli 🦀: 2.9.6 (outdated, latest: 2.11.4)
- @tauri-apps/api ⱼₛ: 2.11.0 (outdated, latest: 2.11.1)
- @tauri-apps/cli ⱼₛ: 2.11.0 (outdated, latest: 2.11.4)

[-] Plugins
- tauri-plugin-os 🦀: 2.3.2
- @tauri-apps/plugin-os ⱼₛ: 2.3.2
- tauri-plugin-dialog 🦀: 2.7.1
- @tauri-apps/plugin-dialog ⱼₛ: 2.7.0 (outdated, latest: 2.7.1)
- tauri-plugin-opener 🦀: 2.5.4
- @tauri-apps/plugin-opener ⱼₛ: 2.5.3 (outdated, latest: 2.5.4)
- tauri-plugin-store 🦀: 2.4.3
- @tauri-apps/plugin-store ⱼₛ: 2.4.2 (outdated, latest: 2.4.3)
- tauri-plugin-log 🦀: 2.8.0, (outdated, latest: 2.9.0)
- @tauri-apps/plugin-log ⱼₛ: 2.8.0 (outdated, latest: 2.9.0)
- tauri-plugin-fs 🦀: 2.5.1
- @tauri-apps/plugin-fs ⱼₛ: 2.5.0 (outdated, latest: 2.5.1)
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing the dialog plugin command from its TypeScript API through the originating webview label to iOS presentation. Reproduce the issue with UIScene support, multiple windows, and RunEvent::SceneRequested as described. Done means a dialog invoked from window A is presented from A's UIWindowScene/root view controller rather than the most recently created or key window.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, rust, typescript
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
53/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.