Im using react-native-paper
which is a great library, but i ran into a problem when i needed a dropdown menu
, that is overlay on the TextInput
field around it.
Don't want to use any Library
unless it it maintained properly.
return (
<View style={{ top: StatusBar.currentHeight }}>
<View
style={{
flexDirection: 'row',
justifyContent: 'space-around',
marginVertical: 10,
}}>
<TextInput
label={'Title'}
placeholder={'Mr'}
value={userinput}
style={{ width: '30%' }}
onChangeText={(text) => setUserinput(text)}
right={<TextInput.Icon icon="chevron-down" size={20} />}
/>
<TextInput label={'First name'} style={{ width: '60%' }} />
</View>
<View style={{ alignSelf: 'center', width: '95%' }}>
<TextInput
label={'Phone number'}
onChangeText={(text) => setUserinput(text)}
/>
</View>
</View>
);
Bare minimum Expo Snack code.
Already tried
Although
react-native-paper
providesList
&List.Accordion
but my problem is not solving by that. issue When list is open the other text bot field are also extending there height.Mapping function, Flatlist, issue not getting the results that i want.
Position: Absolute
issue Mapping is not working accordingly.
I did it using
flatlist
withzIndex
properties, check my example codeExample:
Note:
marginTop
will be the same as inputheight
and you can also move the flatlist to components