Commit 26140783 authored by ioedeveloper's avatar ioedeveloper Committed by Liana Husikyan

Auto-scroll to bottom on keypress

parent 459acbe1
......@@ -195,7 +195,7 @@ class Terminal extends Plugin {
</div>
`
self._view.term = yo`
<div class="${css.terminal_container}" data-id="terminalContainer" onscroll=${throttle(reattach, 10)}>
<div class="${css.terminal_container}" tabindex="-1" data-id="terminalContainer" onscroll=${throttle(reattach, 10)} onkeypress=${focusinput}>
${self._components.autoCompletePopup.render()}
<div class="bg-secondary" data-id="terminalContainerDisplay" style="
position: absolute;
......@@ -303,10 +303,8 @@ class Terminal extends Plugin {
})
function focusinput (event) {
if (self._view.journal.offsetHeight - (self._view.term.scrollTop + self._view.term.offsetHeight) < 50) {
refocus()
}
}
function refocus () {
self._view.input.focus()
reattach({ currentTarget: self._view.term })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment