Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] Uncaught TypeError during setValue after editor construction #1961

Closed
jasonsanjose opened this issue Nov 16, 2013 · 2 comments
Closed

Comments

@jasonsanjose
Copy link
Contributor

  1. Open this jsfiddle http://jsfiddle.net/jason_sanjose/Hkzs7/1/embedded/result/ (see code below
  2. Open developer tools and observe Uncaught TypeError
// simple CodeMirror instance
var editor = new CodeMirror(document.getElementById("code"), {
    lineNumbers: true
});

editor.setValue("");

Stack trace

Uncaught TypeError: Cannot set property 'selAfter' of undefined codemirror.js:2720
setSelectionAddToHistory codemirror.js:2720
(anonymous function) codemirror.js:5070
(anonymous function) codemirror.js:1520
(anonymous function) codemirror.js:5317
@marijnh
Copy link
Member

marijnh commented Nov 16, 2013

I expect attached patch will help.

@jasonsanjose
Copy link
Contributor Author

Perfect. Confirmed the fix. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants