jonmbake / react-terminal-ui

A terminal react component with support for light and dark modes.
https://jonmbake.github.io/react-terminal-ui/demo/
MIT License
205 stars 30 forks source link

[Fix]: ScrollIntoView on terminal children update #46

Closed romulorod closed 7 months ago

romulorod commented 7 months ago

Everytime the children was updated this was scrolling back into view, and it only does so at the end of the key down input command, after the user presses Enter.

Fixes #33

romulorod commented 7 months ago

I'm trying to use this lib in my project but without the onInput prop, I'm changing the terminal children to render a list of items that gets updated every 3m based on the API response, but when I update the children, the focus get restored and I think we could improve it by restoring the focus on keydown event after the user press Enter.