From cc667d63cdd0b2c6c213548874cf4d54040915a5 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 23 Nov 2020 15:10:39 +0100 Subject: [PATCH] :bug: Add autofocus on comment creation input. --- frontend/src/app/main/ui/comments.cljs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/app/main/ui/comments.cljs b/frontend/src/app/main/ui/comments.cljs index a16dec9e7..3d989b091 100644 --- a/frontend/src/app/main/ui/comments.cljs +++ b/frontend/src/app/main/ui/comments.cljs @@ -36,6 +36,8 @@ placeholder (obj/get props "placeholder") on-change (obj/get props "on-change") on-esc (obj/get props "on-esc") + autofocus? (obj/get props "autofocus") + ref (mf/use-ref) on-key-down @@ -62,6 +64,7 @@ [:textarea {:ref ref + :auto-focus autofocus? :on-key-down on-key-down :on-focus on-focus :on-blur on-blur @@ -150,6 +153,7 @@ [:div.reply-form [:& resizing-textarea {:placeholder (tr "labels.write-new-comment") :value (or content "") + :autofocus true :on-esc on-esc :on-change on-change}] [:div.buttons