How to auto-scroll down to end of Text Area when new text is added


Hey there!

I’ trying to display logs on a text area and was wondering if it was possible to force it to automatically scroll down to the end when adding new logs.

Any Ideas ? :smiley:


I’ve tried the flex-box trick proposed in this topic, but it didn’t do it, maybe I’m missing something obvious…

            'overflow': 'auto',
            'display': 'flex',
            'flex-direction': 'column-reverse'},
                              style={'width': '100%', height': 400}),

My guess is that the flex column-reverse trick applies at the element level in the DOM, but not on the contents of a textarea, which is just a single string.

Googling around suggests that to do this on a textarea contents might require javascript.


Ok, thanks for the Help :slight_smile:


Hello @jajarbins, I am facing the same issue. I’d like to know by any chance if you found a solution?

Thx for your help


Hi, you can try using visdcc.Run_js to write your own javascript event listener and action. :slightly_smiling_face:
here is the example code

1 Like