I tried to used CodeMirror 2 for making a text editor in UIWebview IOS 5. But i had problem in text selection. I couldn't select text.
This is codemirror code in codemirror.js,
// Wraps and hides input textarea:
'<div style="overflow: hidden; position: relative; ' +
'width: 3px; height: 0px;">' +
'<textarea style="position: absolute; padding: 0; ' +
'width: 1px;" wrap="off" autocorrect="off" ' +
'autocapitalize="off">' +
'</textarea>' +
'</div>' +
from that code, I think i have to use "div" with contenteditable properties. I plan to change textarea become "div" with contenteditable property becouse for now, iOS 5 has support contenteditable property. But, i'm not sure how to do that. Any one know how to solve my problem?
Thank you
CodeMirror was build in a way to avoid using contentEditable, because is not implemented the same across browsers.
This is a demo of a custom build of CodeMirror2 that works on iOS (I am not the author): http://www.litech.org/~schanzer/iOS/
If you're interested in the changes that were made to make it work try searching for "iOS" or "CHANGE" in the source, or use it as it is.
Here the updated source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With