-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Describe the bug
We want to be able to create a second window on the onFocus event in a React input component, while keeping the same input focused.
Seems like the intended way of doing this is setting the focus property to false, but this doesn't seem to do the trick.
We also tried using setFocus() inside the "tauri://created" listener to re-focus the primary window manually but this seems to cause a deadlock, as the cursor in the input is blinking but the first button pressed does not register.
Reproduction
- Go to repo https://github.com/Andrepav1/tauri-multi-window
- Run
yarn&&yarn start - Run
tauri dev - Focus input component and wait window creation
- Press any key
Expected behavior
Create the window, while keeping the focus on the input component.
Platform and versions
Environment
› OS: Windows 10.0.19044 X64
› Webview2: 104.0.1293.70
› MSVC:
- Visual Studio Build Tools 2022
› Node.js: 16.15.0
› npm: 8.5.5
› pnpm: 7.1.0
› yarn: 1.22.15
› rustup: 1.25.1
› rustc: 1.62.1
› cargo: 1.62.1
› Rust toolchain: stable-x86_64-pc-windows-msvc
Packages
› @tauri-apps/cli [NPM]: 1.0.5
› @tauri-apps/api [NPM]: 1.0.2
› tauri [RUST]: 1.0.5,
› tauri-build [RUST]: 1.0.4,
› tao [RUST]: 0.12.2,
› wry [RUST]: 0.19.0,
App
› build-type: bundle
› CSP: default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
› distDir: ../build
› devPath: http://localhost:3000/
› framework: React
App directory structure
├─ .git
├─ node_modules
├─ public
├─ src
└─ src-tauri
Stack trace
no stack traceAdditional context
No response