Skip to content

Commit d18c52a

Browse files
committed
1 parent 94f8d2d commit d18c52a

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ var CodeMirror = function (_React$Component) {
196196

197197
if (!this.props.resetCursorOnSet) {
198198

199-
this.props.autoScrollCursorOnSet ? this.editor.setCursor(this.cursorPos, null, { scroll: false }) : this.editor.setCursor(this.cursorPos);
199+
!this.props.autoScrollCursorOnSet && this.props.autoScrollCursorOnSet !== undefined ? this.editor.setCursor(this.cursorPos, null, { scroll: false }) : this.editor.setCursor(this.cursorPos);
200200
}
201201
}
202202
}, {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-codemirror2",
3-
"version": "0.0.11",
3+
"version": "0.0.12",
44
"description": "a tiny react codemirror component wrapper",
55
"main": "index.js",
66
"scripts": {

src/react-codemirror2.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ export default class CodeMirror extends React.Component {
168168

169169
if (!this.props.resetCursorOnSet) {
170170

171-
this.props.autoScrollCursorOnSet ?
171+
!this.props.autoScrollCursorOnSet && this.props.autoScrollCursorOnSet !== undefined ?
172172
this.editor.setCursor(this.cursorPos, null, {scroll: false}) : this.editor.setCursor(this.cursorPos);
173+
174+
173175
}
174176
}
175177

0 commit comments

Comments
 (0)