From 4bc27c266710fbab8c028c6fdbaf4fd158b3dcc2 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Mon, 10 May 2021 15:10:31 -0700 Subject: Fixed up keyboard mentions --- src/components/common/TaggTypeahead.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/components/common') 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 = ({ + textRef, keyword, onSuggestionPress, }) => { @@ -19,7 +20,7 @@ const TaggTypeahead: React.FC = ({ }, [keyword]); const getQuerySuggested = async () => { - if (!keyword || keyword.length < 3) { + if (!keyword) { setResults([]); return; } @@ -41,7 +42,9 @@ const TaggTypeahead: React.FC = ({ showsVerticalScrollIndicator={false} onLayout={(event) => { setHeight(event.nativeEvent.layout.height); - }}> + }} + keyboardShouldPersistTaps={'always'} + > {results.map((user) => ( { @@ -50,6 +53,7 @@ const TaggTypeahead: React.FC = ({ name: user.username, }); setResults([]); + textRef.current.focus(); }} user={user} /> -- cgit v1.2.3-70-g09d2