onChangeItem not getting triggerred and items in scrollview don't scroll
See original GitHub issueDescribe the bug
- The
onChangeItemfunction is not been triggered - When the items are much it doesn’t scroll
To Reproduce Here is my picker component
items={items}
defaultValue={this.state.activeValue}
containerStyle={{
flex: 1,
height: getResponsiveHeight(50),
}}
style={{
backgroundColor: 'rgba(151, 151, 151, 0.05)',
}}
dropDownStyle={{
backgroundColor: 'rgba(151, 151, 151, 0.05)',
}}
placeholder={placeholder}
itemStyle={{justifyContent: 'flex-start'}}
labelStyle={styles.inputStyle}
arrowColor={'#C8DAFF'}
zIndex={200}
onOpen={() => this.setState({open: true})}
onClose={() => this.setState({open: false})}
disabled={false}
scrollViewProps={{
scrollEnabled: true,
showsVerticalScrollIndicator: true,
horizontal: false,
// style: {flex: 1, flexDirection: 'column'},
// contentContainerStyle: {alignItems: 'flex-start', flexDirection: 'column'},
}}
dropDownMaxHeight={200}
onChangeItem={(item) => {
console.log({item});
this.setState({activeValue: item.value});
onChangeItem(item);
}}
/>```
and this is how it's been used
```<Picker
placeholder={'Gender'}
items={[
{label: 'Male', value: 'male'},
{label: 'Female', value: 'female'},
{label: 'Male1', value: 'male1'},
{label: 'Female1', value: 'fem1ale'},
{label: 'Male11', value: 'male2'},
{label: 'Female11', value: 'fem2ale'},
{label: 'Male', value: 'male3'},
{label: 'Female', value: 'fem3ale'},
{label: 'Male2', value: 'male4'},
{label: 'Female2', value: 'fem4ale'},
{label: 'Male22', value: 'male5'},
{label: 'Female22', value: 'fem5ale'},
{label: 'Male', value: 'male6'},
{label: 'Female', value: 'fem6ale'},
{label: 'Male12', value: 'male7'},
{label: 'Female12', value: 'fem7ale'},
{label: 'Male123', value: 'male8'},
{label: 'Female123', value: 'fem8ale'},
{label: 'Male', value: 'male9'},
{label: 'Female', value: 'fem9ale'},
{label: 'Male3', value: 'mal10e'},
{label: 'Female3', value: 'fem10ale'},
{label: 'Male33', value: 'male11'},
{label: 'Female33', value: 'fema11le'},
{label: 'Male333', value: 'male12'},
{label: 'Female333', value: 'fema12le'},
{label: 'Male', value: 'male13'},
{label: 'Female', value: 'fema13le'},
]}
// activeValue={'female'}
// editable={false}
/>```
**Expected behavior**
onClickItem should be triggered and items should be scrollable
**Screenshots**
**Info (please complete the following information):**
- OS: [Android]
- Package version [^3.6.7]
**Edited**
[Snack reproduction link](https://snack.expo.io/@bellemeee/dropdown-picker-issue)
Works on snack, but doesn't work on emulator or real device
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
scrollview can't scroll when focus textinput react native
In my case this was being caused by the alignment of the input text—the issue appears when the text is center-aligned or right-aligned....
Read more >Keyboard issues in ScrollView. - Our Blogs
When we use TextInput inside a scrollable page there are a couple of issues i mostly ran into with the keyboard being in...
Read more >Is there a way to keep the keyboard open even when input ...
By setting the ScrollView prop keyboardShouldPersistTaps="handled" allowed the user to enter text into the TextInput and click on the save ...
Read more >Common bugs in React Native ScrollView and how to fix them
The first and most common mistake of using ScrollView is not knowing when to use it. There are two common List components in...
Read more >react-native-input-scroll-view - npm
Put your finger on top of TextInput and slide ScrollView , when you lift your finger, the TextInput will not get focus.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

yo @hossein-zare thanks man, works fine. I removed all the wrapper divs. also made use of the comment on containerStyle and style
Your
styles.inputContainerStylecontains illegal props.https://github.com/hossein-zare/react-native-dropdown-picker#zindex-conflicts-untouchable-items-overlapping-pickers