Skip to content

Commit 6b36e83

Browse files
committed
1 parent d18c52a commit 6b36e83

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

docs/app.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ var CodeMirror = function (_React$Component) {
220220
this.props.editorDidConfigure(this.editor);
221221
}
222222

223-
if (this.props.value && !this.hydrated) {
223+
if (!this.hydrated) {
224224

225-
this.editor.setValue(props.value);
225+
this.editor.setValue(props.value || '');
226226

227227
if (this.props.onValueSet) {
228228
this.props.onValueSet(this.editor, this.editor.getValue());

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-codemirror2",
3-
"version": "0.0.12",
3+
"version": "0.0.13",
44
"description": "a tiny react codemirror component wrapper",
55
"main": "index.js",
66
"scripts": {
@@ -46,17 +46,17 @@
4646
"babel-preset-react": "6.24.1",
4747
"babel-register": "6.24.1",
4848
"css-loader": "0.28.4",
49-
"express": "4.15.3",
49+
"express": "4.15.4",
5050
"js-beautify": "1.6.14",
5151
"node-sass": "4.5.3",
5252
"open": "0.0.5",
5353
"prismjs": "1.6.0",
5454
"react": "15.6.1",
5555
"react-dom": "15.6.1",
56-
"react-redux": "5.0.5",
56+
"react-redux": "5.0.6",
5757
"redux": "3.7.2",
5858
"sass-loader": "6.0.6",
5959
"style-loader": "0.18.2",
60-
"webpack": "3.4.1"
60+
"webpack": "3.5.3"
6161
}
6262
}

src/react-codemirror2.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ export default class CodeMirror extends React.Component {
170170

171171
!this.props.autoScrollCursorOnSet && this.props.autoScrollCursorOnSet !== undefined ?
172172
this.editor.setCursor(this.cursorPos, null, {scroll: false}) : this.editor.setCursor(this.cursorPos);
173-
174-
175173
}
176174
}
177175

@@ -190,9 +188,9 @@ export default class CodeMirror extends React.Component {
190188
this.props.editorDidConfigure(this.editor);
191189
}
192190

193-
if (this.props.value && !this.hydrated) {
191+
if (!this.hydrated) {
194192

195-
this.editor.setValue(props.value);
193+
this.editor.setValue(props.value || '');
196194

197195
if (this.props.onValueSet) {
198196
this.props.onValueSet(this.editor, this.editor.getValue());

0 commit comments

Comments
 (0)