diff options
author | Ivan Chen <ivan@tagg.id> | 2021-07-15 17:09:37 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-07-15 17:09:37 -0400 |
commit | 2f2c4a4559bf072cae3b2c2cb42e500c8b71db7a (patch) | |
tree | c71c9f9f1e8ad0a4d072c6e20f1188930a8fec69 /src/components/common | |
parent | d7e5fa1ac7728290d1f1fc51b984dc40b1feb323 (diff) |
Fix to use correct component's height
Diffstat (limited to 'src/components/common')
-rw-r--r-- | src/components/common/TaggTypeahead.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
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<TaggTypeaheadProps> = ({ } }, [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<TaggTypeaheadProps> = ({ return ( <View ref={viewRef} onLayout={onLayout}> - {/* <View ref={viewRef} onLayout={onLayout}> */} {!isShowBelowStyle && <View style={styles.overlay} />} <ScrollView style={[ @@ -84,6 +82,9 @@ const TaggTypeahead: React.FC<TaggTypeaheadProps> = ({ : {top: -height, margin: margin}, ]} showsVerticalScrollIndicator={false} + onLayout={(event) => { + setHeight(event.nativeEvent.layout.height); + }} keyboardShouldPersistTaps={'always'}> {results.map((user) => ( <TaggUserRowCell |