Browse code

Dispatch the window scroll event after command submission

Joseph Weston authored on 06/12/2021 03:25:53
Showing 1 changed files
... ...
@@ -57,4 +57,7 @@
57 57
       (as-> db
58 58
         (let [output (execute db cmdline)]
59 59
             (update-in db [:cmdline :history] conj
60
-                {:input cmdline :output output}))))})))
60
+                {:input cmdline :output output}))))
61
+     ; dispatch-later to ensure that the DOM has already been updated,
62
+     ; so that scrollMaxY has been changed appropriately.
63
+     :fx [[:dispatch-later {:ms 10 :dispatch [::scroll-to-bottom]}]]})))