Slow Scrolling on Ace Text Editor For Mobile Touch Screen Devices
I'm trying to get The JavaScript code editor ACE to work on a mobile device.
var editor = ace.edit("editor");
editor.setTheme("ace/theme/twilight");
editor.getSession().setMode("ace/mode/css");
You can find the full code here
The vertical scrolling does not seem to respond at all for any mobile device and it's lagging a lot. How can I make it more responsive?
As far as I'm aware, codemirror hasn't had any performance issues for ages, so try to use that. Here's your jsfiddle but with codemirror instead: https://jsfiddle.net/DerpMarine/j54gfecL/16/
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/codemirror.js"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/codemirror.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/mode/css/css.js"></script>
</body>
<script>
var myCodeMirror = CodeMirror(function(elt) {
document.getElementById('editor').parentNode.replaceChild(elt, document.getElementById('editor'));
},{
mode: "css",
theme: "custom", // https://codemirror.net/doc/manual.html#option_theme and https://codemirror.net/theme/
value: document.getElementById('editor').value
});
</script>
https://codemirror.net/doc/manual.html