tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] [v2] undo and redo shortcuts don't work in popular editor on MacOS

Open percy507 opened this issue 1 year ago • 5 comments

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
image

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

percy507 avatar Jun 28 '24 12:06 percy507

Tauri with unstable feature enabled will create a webview as child and fall into #9426.

pewsheen avatar Jul 01 '24 03:07 pewsheen

True. I remove unstable feature and refactor the related code. The problem seems been resolved.

percy507 avatar Jul 17 '24 03:07 percy507

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

twhitson avatar Feb 13 '25 22:02 twhitson

that seems to have automatically been added to my Cargo.toml when adding the SQL plugin

that shouldn't be possible

FabianLars avatar Feb 14 '25 12:02 FabianLars

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.

mtsgrd avatar May 21 '25 11:05 mtsgrd