aboutsummaryrefslogtreecommitdiff
path: root/src/components/comments/AddComment.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-06-10 19:20:19 -0400
committerIvan Chen <ivan@tagg.id>2021-06-10 19:20:19 -0400
commit2f9ecfb9bc89c7c6e7ac09952b97d3f3813075bc (patch)
tree352386ad82382a506b49232473bdab820e6fe4ff /src/components/comments/AddComment.tsx
parent770dcf385fa99fbb93c4ae89a51b09fd96d23bf9 (diff)
Add logic for keyboard focus
Diffstat (limited to 'src/components/comments/AddComment.tsx')
-rw-r--r--src/components/comments/AddComment.tsx5
1 files changed, 4 insertions, 1 deletions
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(