Scroll textarea to bottom when adding text

As I add text to a read-only textarea I would like the scroll bar to automatically scroll the last text into view. I am using Vaadin 14.3.2. I do not see a Java API for doing that. I have tried the javascript below but, while the background color is set, the text is not scrolled. The value of scrollHeight increases but the value of scrollTop remains 0.

TextArea textArea = new TextArea();

	after text is added

textArea.getElement().executeJs("var ta = this.inputElement; = '#FFAAAA'; ta.scrollTop = ta.scrollHeight;");

I am a javacript novice so I may be missing something. Any help would be appreciated.