File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import { UnControlled as CodeMirror } from 'react-codemirror2'
2+ import { Controlled as CodeMirror } from 'react-codemirror2'
33import { connect } from 'react-redux' ;
44import { CodeUpdate } from '../actions/codeUpdate' ;
55
@@ -21,16 +21,24 @@ class Editor extends React.Component {
2121 undo : true ,
2222 redo : true ,
2323 smartIndent : true ,
24+ autoCursor : false ,
2425 theme : this . props . theme ,
2526 } ;
2627 const customMode = {
2728 name : 'jsonnet' ,
2829 fn : jsonnetMode ,
2930 } ;
3031 return (
31- < div className = 'editor' > < CodeMirror value = { code }
32- onChange = { this . updateCode } options = { options }
33- defineMode = { customMode } /> </ div > ) ; }
32+ < div className = 'editor' >
33+ < CodeMirror
34+ value = { code }
35+ onBeforeChange = { this . updateCode }
36+ options = { options }
37+ defineMode = { customMode }
38+ />
39+ </ div >
40+ ) ;
41+ }
3442}
3543
3644const mapStateToProps = state => {
You can’t perform that action at this time.
0 commit comments