aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/comments/AddComment.tsx2
-rw-r--r--src/components/common/TaggTypeahead.tsx8
2 files changed, 7 insertions, 3 deletions
diff --git a/src/components/comments/AddComment.tsx b/src/components/comments/AddComment.tsx
index 9cf10b5e..7e440daf 100644
--- a/src/components/comments/AddComment.tsx
+++ b/src/components/comments/AddComment.tsx
@@ -123,7 +123,7 @@ const AddComment: React.FC<AddCommentProps> = ({momentId, placeholderText}) => {
);
}}
inputRef={ref}
- partTypes={mentionPartTypes('blue')}
+ partTypes={mentionPartTypes('blue', ref)}
/>
<View style={styles.submitButton}>
<TouchableOpacity style={styles.submitButton} onPress={addComment}>
diff --git a/src/components/common/TaggTypeahead.tsx b/src/components/common/TaggTypeahead.tsx
index 7cd99278..bef72851 100644
--- a/src/components/common/TaggTypeahead.tsx
+++ b/src/components/common/TaggTypeahead.tsx
@@ -8,6 +8,7 @@ import {SCREEN_WIDTH} from '../../utils';
import TaggUserRowCell from './TaggUserRowCell';
const TaggTypeahead: React.FC<MentionSuggestionsProps> = ({
+ textRef,
keyword,
onSuggestionPress,
}) => {
@@ -19,7 +20,7 @@ const TaggTypeahead: React.FC<MentionSuggestionsProps> = ({
}, [keyword]);
const getQuerySuggested = async () => {
- if (!keyword || keyword.length < 3) {
+ if (!keyword) {
setResults([]);
return;
}
@@ -41,7 +42,9 @@ const TaggTypeahead: React.FC<MentionSuggestionsProps> = ({
showsVerticalScrollIndicator={false}
onLayout={(event) => {
setHeight(event.nativeEvent.layout.height);
- }}>
+ }}
+ keyboardShouldPersistTaps={'always'}
+ >
{results.map((user) => (
<TaggUserRowCell
onPress={() => {
@@ -50,6 +53,7 @@ const TaggTypeahead: React.FC<MentionSuggestionsProps> = ({
name: user.username,
});
setResults([]);
+ textRef.current.focus();
}}
user={user}
/>