tauri
tauri copied to clipboard
[bug] [v2] undo and redo shortcuts don't work in popular editor on MacOS
Describe the bug
In tauri v2-beta, the undo and redo shortcuts don't work in popular editor on MacOS. (Focus the editor, then press enter key, then undo, you will see the bug without any error message.)
I also test on windows 10, they work fine. Then I test on MacOS with lastest tauri v1, they also work fine.
ps: I notice this issue #9426, but it doesn't help for me.
Here is the test demo. https://github.com/percy507/test-tauri-v2/tree/undo-redo-donot-work-in-editor
# v2-beta on MacOS
textarea works
contenteditable works
the rest editors doesn't work
Reproduction
https://github.com/percy507/test-tauri-v2/tree/undo-redo-donot-work-in-editor
Expected behavior
No response
Full tauri info output
[✔] Environment
- OS: Mac OS 13.2.1 X64
✔ Xcode Command Line Tools: installed
✔ rustc: 1.75.0 (82e1608df 2023-12-21)
✔ cargo: 1.75.0 (1d8b05cdd 2023-11-20)
✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
✔ Rust toolchain: stable-aarch64-apple-darwin (default)
- node: 20.7.0
- pnpm: 8.3.1
- yarn: 1.22.21
- npm: 10.1.0
[-] Packages
- tauri [RUST]: 2.0.0-beta.22
- tauri-build [RUST]: 2.0.0-beta.17
- wry [RUST]: 0.40.1
- tao [RUST]: 0.28.1
- @tauri-apps/api [NPM]: 2.0.0-beta.13
- @tauri-apps/cli [NPM]: 2.0.0-beta.20
[-] App
- build-type: bundle
- CSP: unset
- frontendDist: ../dist
- devUrl: http://localhost:1420/
- framework: React
- bundler: Vite
Stack trace
No response
Additional context
No response
Tauri with unstable feature enabled will create a webview as child and fall into #9426.
True. I remove unstable feature and refactor the related code. The problem seems been resolved.
Noting that this is still an issue with the unstable flag that seems to have automatically been added to my Cargo.toml when adding the SQL plugin
that seems to have automatically been added to my Cargo.toml when adding the SQL plugin
that shouldn't be possible
Just want to chime in here and say I'm having undo issues with lexical.dev using its HistoryPlugin. The reason seems to be that ctrl+z is swallowed by PredefinedMenuItem::undo.
If I understand correctly, in a browser the native undo is triggered after a keyboard event (unless preventDefault is called), while in Tauri the keyboard event never reaches the webview.