Setting cursor at end of added text to Textarea

I’m using a textarea as a sort of log console in a page, which receives data to be added at the end of the current text. When i add more text to the textarea, how can i make it so it scrolls down as new text is added?

Hi,

You need to work with the Textarea’s input node to manipulate scroll position and cursor:

var log = $$("log");
var pos = log.getValue().length;
var height = log.getInputNode().scrollHeight;

//set cursor in the end
webix.html.setSelectionRange(log.getInputNode(), pos);
//show the input end
$$("log").getInputNode().scrollTop = height;

Check the following snippet, please: http://webix.com/snippet/0680e4ab

Sorry,I did as you said but I have this error: Uncaught RangeError: Maximum call stack size exceeded.

Hello,

I’ve checked the snippet in my environment and everything is working smoothly. Could you please provide the exact snippet of your implementation and share the OS/browser in use?