diff options
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/controllers/results_controller.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/javascript/controllers/results_controller.js b/app/javascript/controllers/results_controller.js new file mode 100644 index 0000000..266b80c --- /dev/null +++ b/app/javascript/controllers/results_controller.js @@ -0,0 +1,13 @@ +import { Controller } from "stimulus"; + +export default class extends Controller { + static targets = [ "output" ]; + + connect() { + this.scrollToBottom(); + } + + scrollToBottom() { + this.outputTarget.scrollTop = this.outputTarget.scrollHeight; + } +} |