ctrl z不在我的slateJs编辑器中工作,但在板岩实例中运行得很好。
<Slate editor={editor} value={initialValue}>
<Editable
renderElement={renderElement}
renderLeaf={renderLeaf}
...
...
onKeyDown = {()=> {
console.log('key pressed')
}
</Editable>
</Slate>发布于 2022-10-26 19:31:44
您必须使用withHistory,就像您给出的示例的来源一样:https://github.com/ianstormtaylor/slate/blob/main/site/examples/richtext.tsx#L28用于默认的撤消和重做行为
https://stackoverflow.com/questions/73847898
复制相似问题