kommitters / editorjs-undo

Undo/Redo feature for Editor.js
https://www.npmjs.com/package/editorjs-undo
MIT License
169 stars 51 forks source link

Add shortcut for Cmd + Shift + Z to redo #203

Closed CristhianRodriguezMolina closed 1 year ago

CristhianRodriguezMolina commented 1 year ago

Description

Close #176

Now the users can redo the blocks with both the CMD+Y and CMD+SHIFT+Z, but also still can configure both custom shortcuts as always:

new Undo({
  editor,
  config: {
    shortcuts: { undo: "CMD+F", redo: "CMD+G" },
  },
});

Solution

The solution was to use arrays to manage multiple shortcuts for undo and redo, if it's necessary we can also update the code a little to allow users to set all the shortcuts they want for both undo and redo commands.