                        (vlib/safe-html (:message bubble))))))))
 
 (defn bubbles-view []
-  (apply dom/ol #js {:className "bubbles"}
-         (map #(om/build bubble-view (lib/merge-react-key %)) (lib/get-bubbles))))
+  (reify
+    om/IDidUpdate
+    (did-update [_this _prev-props _prev-state]
+      (vlib/scroll-divs-to-bottom "bubbles"))
+    om/IRender
+    (render [_]
+      (apply dom/ol #js {:className (lib/prefix-name "bubbles")}
+             (map #(om/build bubble-view (lib/merge-react-key %)) (lib/get-bubbles))))))
 
 (defn item-view [item _owner]
   (reify om/IRender

(defn discussion-elements [data]
  (if-not (empty? (:discussion @lib/app-state))
    (dom/div nil
             (bubbles-view)
             (items-view data)
             (control-elements))
    (init-view)))


(ns discuss.views
  (:require [om.core :as om :include-macros true]
            [om.dom :as dom :include-macros true]
            [goog.dom :as gdom]
            [clojure.string :as string]
            [discuss.auth :as auth]
            [discuss.clipboard :as clipboard]
