Closed ollietreend closed 1 year ago
Hi @ollietreend Have you tried to config the redo action command in your Undo instance?
You can read more about, how to custom the undo and redo commands here: https://github.com/kommitters/editorjs-undo#add-a-custom-shortcut-to-undo-and-redo
const config = {
shortcuts: {
undo: 'CMD+Z',
redo: 'CMD+SHIFT+Z'
}
}
const undo = new Undo({ editor, config });
However, we can review to support both default commands for the redo action:
CTRL
/CMD
+ Y
CTRL
/CMD
+ SHIFT
+ Z
You must use version >= 2.0, to config the redo action with
CTRL
/CMD
+SHIFT
+Z
Hi @karolrojas07. Thanks for looking at this.
I think the ideal situation would be for the redo command to support both shortcuts as out-the-box defaults. That will provide the most 'native' / expected experience for end users – who otherwise might not realise that 'redo' is available.
I guess this change is dependent on the ability to set two shortcuts for the same command. It sounds like only one shortcut is supported right now?
Hi @ollietreend.
This feature is now available on version v2.0.21
, you are now able to redo using both shortcuts CMD+Y
and CMD+SHIFT+Z
by default :+1:
Is your feature request related to a problem? Please describe.
Ctrl
/Cmd
+Z
is the universally accepted keyboard shortcut to undo something.However the shortcut for redo varies between different operating systems:
Ctrl
+Y
(Windows)On Windows, it's common for redo be mapped to
Ctrl
+Y
.But on Mac,
Cmd
+Y
has no effect in most applications. And sometimes it does something else entirely – for example, in Chrome it opens History.Ctrl
/Cmd
+Shift
+Z
(Mac, Linux)This is the redo keyboard shortcut on Mac and Linux.
As a Mac user, I can confirm that
Cmd
+Shift
+Z
performs the redo action consistently in all applications throughout the operating system. I believe this is also true for Linux.The picture seems less clear on Windows. Some applications seem to support
Ctrl
+Y
whereas other supportCtrl
+Shift
+Z
(or both).This is corroborated by: https://keyboardshortcuts.org/redo
Describe the solution you'd like
It'd be great if the redo feature supported both
Ctrl
+Y
andCtrl
/Cmd
+Shift
+Z
keyboard shortcuts. That way it'd be more discoverable and feel native to users of non-Windows operating systems.Personally, I have a strong muscle memory for
Cmd
+Shift
+Z
which is why I've noticed this. It breaks my internal expectations of how an editor behaves on Mac. I expect the same is true for people using iOS devices with an attached keyboard.Additional context
I haven't actually tried mapping redo to both shortcuts, so am unsure whether this is a trivial change or if it's limited to one single shortcut only.
But I thought I'd report this here as it doesn't seem to have been raised yet – although I do see that it was touched upon in #106.