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 { ...@@ -195,7 +195,7 @@ class Terminal extends Plugin {
</div> </div>
` `
self._view.term = yo` 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()} ${self._components.autoCompletePopup.render()}
<div class="bg-secondary" data-id="terminalContainerDisplay" style=" <div class="bg-secondary" data-id="terminalContainerDisplay" style="
position: absolute; position: absolute;
...@@ -303,10 +303,8 @@ class Terminal extends Plugin { ...@@ -303,10 +303,8 @@ class Terminal extends Plugin {
}) })
function focusinput (event) { function focusinput (event) {
if (self._view.journal.offsetHeight - (self._view.term.scrollTop + self._view.term.offsetHeight) < 50) {
refocus() refocus()
} }
}
function refocus () { function refocus () {
self._view.input.focus() self._view.input.focus()
reattach({ currentTarget: self._view.term }) 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