Skip to content

Commit 0cfc009

Browse files
oliviertassinariDaniel Rabe
authored and
Daniel Rabe
committed
[docs] Fix undo/redo in live editor (mui#35163)
1 parent 59caf3c commit 0cfc009

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/src/modules/components/Demo.js

+2
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,8 @@ export default function Demo(props) {
472472
/>
473473
) : (
474474
<DemoEditor
475+
// Mount a new text editor when the preview mode change to reset the undo/redo history.
476+
key={editorCode.isPreview}
475477
value={editorCode.value}
476478
onChange={(value) => {
477479
setEditorCode({

0 commit comments

Comments
 (0)