react-codemirror icon indicating copy to clipboard operation
react-codemirror copied to clipboard

codemirror.js:5921 Uncaught TypeError: textarea.getAttribute is not a function

Open tamtakoe opened this issue 9 years ago • 2 comments

React-Codemirror 0.2.6 doesn't work with React 0.13.3 in last Chrome version

options.autofocus = hasFocus == textarea || textarea.getAttribute("autofocus") != null && hasFocus == document.body;

It looks like textarea does't exist

tamtakoe avatar May 20 '16 08:05 tamtakoe

I'm having the same problem — React-Codemirror 0.2.6, React 0.13.3, Chrome. Any tips on how to resolve?

Top of stack trace is as follows:

CodeMirror.fromTextArea @ codemirror.js:5942
CodeMirror_componentDidMount @ Codemirror.js:30
notifyAll @ CallbackQueue.js:68
close @ ReactReconcileTransaction.js:81
closeAll @ Transaction.js:207
perform @ Transaction.js:148
batchedMountComponentIntoNode @ ReactMount.js:269
perform @ Transaction.js:134
batchedUpdates @ ReactDefaultBatchingStrategy.js:66
batchedUpdates @ ReactUpdates.js:
110_renderNewRootComponent @ ReactMount.js:404
ReactMount__renderNewRootComponent @ ReactPerf.js:70
render @ ReactMount.js:493
React_render @ ReactPerf.js:70163
../editor.jsx @ app.jsx:99
s @ _prelude.js:1
e @ _prelude.js:1
(anonymous function) @ _prelude.js:1

codemirror.js:5942 is this:

textarea.getAttribute("autofocus") != null && hasFocus == document.body

Thanks!

realgenekim avatar Aug 17 '16 09:08 realgenekim

Fixed by upgrading to react@~0.14.2.

(Underlying Codemirror module needs React 14 or 15, so maybe ReactCodemirror also needs this dependency, as well?)

realgenekim avatar Aug 17 '16 16:08 realgenekim