0

ctrl z not working in my slateJs editor, but it is working fine in slate example

    <Slate editor={editor} value={initialValue}>
      <Editable
        renderElement={renderElement}
        renderLeaf={renderLeaf}
        ...
        ...
        onKeyDown = {()=> {
          console.log('key pressed')
        }
      </Editable>
    </Slate>
Aman Ghanghoriya
  • 169
  • 3
  • 10

1 Answers1

1

You have to use withHistory like the source of the example you have given: https://github.com/ianstormtaylor/slate/blob/main/site/examples/richtext.tsx#L28 for default undo and redo behaviour

esp
  • 146
  • 4