diff --git a/src/components/picker/PickerItemsList.tsx b/src/components/picker/PickerItemsList.tsx index 6597e6a10b..5703d0db90 100644 --- a/src/components/picker/PickerItemsList.tsx +++ b/src/components/picker/PickerItemsList.tsx @@ -1,5 +1,5 @@ import _ from 'lodash'; -import React, {useCallback, useContext, useState} from 'react'; +import React, {useCallback, useContext, useMemo, useState} from 'react'; import {StyleSheet, FlatList, TextInput, ListRenderItemInfo, ActivityIndicator} from 'react-native'; import {Typography, Colors} from '../../style'; import Assets from '../../assets'; @@ -80,6 +80,13 @@ const PickerItemsList = (props: PickerItemsListProps) => { return ; }, []); + const _listProps = useMemo(() => { + return { + ...listProps, + style: [styles.list, listProps?.style] + }; + }, [listProps]); + const renderList = () => { if (items) { return ( @@ -88,7 +95,7 @@ const PickerItemsList = (props: PickerItemsListProps) => { data={items} renderItem={renderPropItems} keyExtractor={keyExtractor} - {...listProps} + {..._listProps} /> ); } @@ -99,7 +106,7 @@ const PickerItemsList = (props: PickerItemsListProps) => { renderItem={renderItem} keyExtractor={keyExtractor} testID={`${testID}.list`} - {...listProps} + {..._listProps} /> ); }; @@ -204,6 +211,9 @@ const styles = StyleSheet.create({ paddingRight: 16, flex: 1, ...Typography.text70 + }, + list: { + height: '100%' } });