react-codemirror
react-codemirror copied to clipboard
CTRL+Z empties the content
If you focus on the editor and press CTRL+Z
the content dissapears. I think this is not expected behavior. This issue happens in both v3 and v4 demos in react-codemirror
.
This doesn't happen in the codemirror demo, so I think it's an issue with react-codemirror
package.
Any fixes or workarounds?
@supunkavinda I didn't reproduce your problem.
- Go to the demo: https://uiwjs.github.io/react-codemirror/
- Focus somewhere in the code editor
- Click
Ctrl + Z
. It empties the code editor
It is happening for me on Safari/Chrome/Firefox on macOS
This is codemirror's history feature. The default display interface, the editor shows the example, and the value
is changed once.
Yeah, but it doesn't happen on CodeMirror demos (trying ctrl+z on these demo code editors, they don't do anything):
https://codemirror.net/ https://codemirror.net/6/
General, why should ctrl + z
should empty content? 🤔
I think in react-codemirror, CodeMirror is getting the empty value as the first value.
Does that make sense?
@supunkavinda There is no such problem in the example.
https://codesandbox.io/embed/react-codemirror-example-codemirror-6-slvju?fontsize=14&hidenavigation=1&theme=dark