                                   (.destroy @clipboard-atom)
                                   (reset! clipboard-atom nil)))
       :reagent-render         (fn [child] child)})))
+
+(defn focus-node [node]
+  (-> (r/dom-node node)
+      (.focus)))
 
 (defn on-repl-eval [state num [ns expression]]
   (when num

(defn pprint-str [data]
  (with-out-str (fipp/pprint data)))


(defn clipboard [child]
  (let [clipboard-atom (atom nil)]

     [:form {:action "#" "autoComplete" "off"}
      [mdl/upgrade
       [:div.wide.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label
        [trigger
         {:component-did-mount focus-node}
         [:input.wide.mdl-textfield__input
          {:type         :text
           :id           "input"
           :autocomplete "off"
           :value        input
           :disabled     (not is-init?)
           :on-change    #(swap! state input-on-change %)
           :on-key-down  #(input-key-down state %)}]]
        ^{:key is-init?}
        [:label.mdl-textfield__label {:for "input"}
         (str ns "=>")]]]]]))
