diff options
author | David Gay <david@davidgay.org> | 2021-06-09 21:49:46 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-06-09 21:49:51 -0400 |
commit | 779f19c5b35f7c8c7690dac9fbf4606f49cfffde (patch) | |
tree | 115131c535b3b2577e2f92eb1e914d79a17feb6b /app/javascript/controllers | |
parent | 40db33e9789f85b55bdf3dc02fe6c6a7547a2378 (diff) |
Only scroll chat and results output to the bottom on new content when already scrolled to the bottom or near the bottom
Diffstat (limited to 'app/javascript/controllers')
-rw-r--r-- | app/javascript/controllers/chat_controller.js | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/app/javascript/controllers/chat_controller.js b/app/javascript/controllers/chat_controller.js index d9cf1cb..95b61c5 100644 --- a/app/javascript/controllers/chat_controller.js +++ b/app/javascript/controllers/chat_controller.js @@ -12,7 +12,6 @@ export default class extends Controller { // TODO: Temporary hack. Should just run this after default event. setTimeout(function() { vm.messageTarget.value = ""; - vm.smoothScrollToBottom(); }, 100); } @@ -31,12 +30,4 @@ export default class extends Controller { scrollToBottom() { this.outputTarget.scrollTop = this.outputTarget.scrollHeight; } - - smoothScrollToBottom() { - this.outputTarget.scrollTo({ - top: this.outputTarget.scrollHeight, - left: 0, - behavior: 'smooth' - }); - } } |