react-codemirror2
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -151,5 +151,13 @@ 'use strict'; | ||
this.hydrated = false; | ||
if (!this.props.resetCursorOnSet) { | ||
this.cursorPos = this.editor.getCursor(); | ||
} | ||
} | ||
this.hydrate(nextProps); | ||
if (!this.props.resetCursorOnSet) { | ||
this.editor.setCursor(this.cursorPos); | ||
} | ||
} | ||
@@ -178,2 +186,3 @@ }, { | ||
if (this.props.value && !this.hydrated) { | ||
this.editor.setValue(props.value); | ||
@@ -180,0 +189,0 @@ |
{ | ||
"name": "react-codemirror2", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "a tiny react codemirror component wrapper", | ||
@@ -57,7 +57,7 @@ "main": "index.js", | ||
"react-redux": "5.0.5", | ||
"redux": "3.7.1", | ||
"redux": "3.7.2", | ||
"sass-loader": "6.0.6", | ||
"style-loader": "0.18.2", | ||
"webpack": "3.1.0" | ||
"webpack": "3.2.0" | ||
} | ||
} |
@@ -41,3 +41,3 @@ [](https://travis-ci.org/scniro/react-codemirror2) | ||
```jsx | ||
import CodeMirror from 'react-codemirror2' | ||
import CodeMirror from 'react-codemirror2'; | ||
require('codemirror/mode/xml/xml'); | ||
@@ -53,2 +53,4 @@ require('codemirror/mode/javascript/javascript'); | ||
> triggers `onValueSet` | ||
- `resetCursorOnSet` | ||
> `boolean` reset the internal codemirror cursor position should a new `value` prob be set. Default: `false` | ||
@@ -55,0 +57,0 @@ ## component specific events |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
12771
165
84
0