[x] Do a quick search and make sure the bug has not been reported yet.
[ ] Please disclose security vulnerabilities privately at oss@kommit.co.
[x] Finally, be nice and have fun!.
Description
Undo/Redo does not work on german keyboard layout. Both gets triggered if i press CTRL+Z or CTRL+Y.
This is because of the letter "Y" and "Z" is switched on german keyboard layout. In your code you are using
"e.code" to determine the pressed keyboard combination which shouldn't be used according the specs:
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code
Environment
Editor.js version: 2.25.0
Plugins you use with their versions: 2.0.22
Device, Browser, OS: Chrome/Firefox/Safari/all, Microsoft Windows 11 Pro
Current behavior
Switch to german keyboard layout
type something into a paragraph block.
press Ctrl+z.
Result: Nothing happens (behind the scences the undo-eventlistener gets fired and then the redo-eventlistener)
Expected behavior
Support of german keyboard layout which means the check by "e.code" should be removed.
Precheck
Description
Undo/Redo does not work on german keyboard layout. Both gets triggered if i press CTRL+Z or CTRL+Y. This is because of the letter "Y" and "Z" is switched on german keyboard layout. In your code you are using "e.code" to determine the pressed keyboard combination which shouldn't be used according the specs: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code
Environment
Current behavior
Result: Nothing happens (behind the scences the undo-eventlistener gets fired and then the redo-eventlistener)
Expected behavior
Support of german keyboard layout which means the check by "e.code" should be removed.