                                  )))
 
 (defn focus! []
-  (->> (dom/$$ :.focused)
-       (last)
-       (.focus)))
+  (when-let [cur (last (dom/$$ :.focused))]
+    (.focus cur)))
 
 ;;*********************************************************
 ;; Go!

(defn ref-menu [step & [cb]]
  (fn [e]
    (when (mutable? step)
      (show-menu! e (for [ref (refs-in-scope (current :page) (current :step))]
                      {:label (subs ref 0 5)
                       :action (fn []
                                 (swap! step (constantly (ref-id ref)))
                                 (when cb
                                   (cb)))})))))

(defmethod item-ui :ref/id [step]
  (dom

                           :ref ref
                           :args args}
                      opts)))

(defn table []
  {"headers" ["a" "b"]
   "columns" [{:type :ref/js
               :js "aurora.runtime.table.identity_column"}
              {:type :ref/js
               :js "aurora.runtime.table.identity_column"}]
   "rows" [[1 2] [3 4]]})

(defn ref-id [id]
  {:type :ref/id
