From 2f2c4a4559bf072cae3b2c2cb42e500c8b71db7a Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Thu, 15 Jul 2021 17:09:37 -0400 Subject: Fix to use correct component's height --- src/components/common/TaggTypeahead.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/components/common/TaggTypeahead.tsx b/src/components/common/TaggTypeahead.tsx index 672cff69..d5668a38 100644 --- a/src/components/common/TaggTypeahead.tsx +++ b/src/components/common/TaggTypeahead.tsx @@ -40,8 +40,7 @@ const TaggTypeahead: React.FC = ({ } }, [keyword]); - const onLayout = (e: LayoutChangeEvent) => { - setHeight(e.nativeEvent.layout.height); + const onLayout = (_e: LayoutChangeEvent) => { viewRef.current?.measure( ( _fx: number, @@ -74,7 +73,6 @@ const TaggTypeahead: React.FC = ({ return ( - {/* */} {!isShowBelowStyle && } = ({ : {top: -height, margin: margin}, ]} showsVerticalScrollIndicator={false} + onLayout={(event) => { + setHeight(event.nativeEvent.layout.height); + }} keyboardShouldPersistTaps={'always'}> {results.map((user) => (