From 2f9ecfb9bc89c7c6e7ac09952b97d3f3813075bc Mon Sep 17 00:00:00 2001
From: Ivan Chen <ivan@tagg.id>
Date: Thu, 10 Jun 2021 19:20:19 -0400
Subject: Add logic for keyboard focus

---
 src/components/comments/AddComment.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/components/comments/AddComment.tsx')

diff --git a/src/components/comments/AddComment.tsx b/src/components/comments/AddComment.tsx
index 18b9c24e..9d9824db 100644
--- a/src/components/comments/AddComment.tsx
+++ b/src/components/comments/AddComment.tsx
@@ -25,13 +25,15 @@ export interface AddCommentProps {
   momentId: string;
   placeholderText: string;
   callback?: (message: string) => void;
+  onFocus?: () => void;
   theme?: 'dark' | 'white';
 }
 
 const AddComment: React.FC<AddCommentProps> = ({
   momentId,
   placeholderText,
-  callback = (msg) => null,
+  callback = (_) => null,
+  onFocus = () => null,
   theme = 'white',
 }) => {
   const {setShouldUpdateAllComments = () => null, commentTapped} =
@@ -125,6 +127,7 @@ const AddComment: React.FC<AddCommentProps> = ({
             placeholderTextColor={theme === 'dark' ? '#828282' : undefined}
             placeholder={placeholderText}
             value={inReplyToMention + comment}
+            onFocus={onFocus}
             onChange={(newText: string) => {
               // skipping the `inReplyToMention` text
               setComment(
-- 
cgit v1.2.3-70-g09d2

