diff --git a/src/cljs/grub/view/dom.cljs b/src/cljs/grub/view/dom.cljs index 071e289..c6ea948 100644 --- a/src/cljs/grub/view/dom.cljs +++ b/src/cljs/grub/view/dom.cljs @@ -267,6 +267,9 @@ (defn clear-new-grub-input! [] (dommy/set-value! (sel1 :#add-grub-input) "")) +(defn focus-new-grub-input! [] + (.focus (sel1 :#add-grub-input))) + (extend-type js/HTMLDivElement IRecipe (-expand! [this] diff --git a/src/cljs/grub/view/grub.cljs b/src/cljs/grub/view/grub.cljs index 14738be..ed4386b 100644 --- a/src/cljs/grub/view/grub.cljs +++ b/src/cljs/grub/view/grub.cljs @@ -140,6 +140,7 @@ (dom/-show! dom/clear-all-btn) (sort-and-render-grub-list! new-grubs) (dom/clear-new-grub-input!) + (dom/focus-new-grub-input!) new-grubs)) (defn assoc-new-grub [current new]