diff options
author | Brian Kim <brian@tagg.id> | 2021-05-10 15:10:31 -0700 |
---|---|---|
committer | Brian Kim <brian@tagg.id> | 2021-05-10 15:10:31 -0700 |
commit | 4bc27c266710fbab8c028c6fdbaf4fd158b3dcc2 (patch) | |
tree | 2e1b9409978cf7d321119d398fd0bb468327aa7f /src/components/common | |
parent | 49136f4056cb40f43d282d534aacf27076f47d8b (diff) |
Fixed up keyboard mentions
Diffstat (limited to 'src/components/common')
-rw-r--r-- | src/components/common/TaggTypeahead.tsx | 8 |
1 files changed, 6 insertions, 2 deletions
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} /> |