Comments (12)
Hello, Please edit your issue.
from react-native-dropdown-picker.
Unable to select the dropdown values
from react-native-dropdown-picker.
Others haven't faced the issue, Please add your Code Snippet.
from react-native-dropdown-picker.
<DropDownPicker
items={[
{label: 'India', value: 'in'},
{label: 'France', value: 'france'},
]}
defaultValue={this.state.country}
containerStyle={loginStyles.dropdownStyle}
style={{backgroundColor: '#fafafa'}}
dropDownStyle={{backgroundColor: '#fafafa'}}
onChangeItem={item => this.setState({
country: item.value
})}
/>
from react-native-dropdown-picker.
@sandeepg1220
https://snack.expo.io/@hossein-zare/change-value-example
If you're using an older version, Update it to the latest version. (current version: 3.0.5)
from react-native-dropdown-picker.
Finally found the issue. Check the below code.
I'm using the latest version only.
import * as React from 'react';
import { Text, View, StyleSheet } from 'react-native';
import Constants from 'expo-constants';
import DropDownPicker from 'react-native-dropdown-picker'
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
country: null
}
}
render() {
return (
<View style={styles.container}>
<View>
<DropDownPicker
items={[
{label: 'India', value: 'in'},
{label: 'France', value: 'france'},
{label: 'France', value: 'france'},
{label: 'France', value: 'france'},
]}
defaultValue={this.state.country}
containerStyle={{}}
style={{backgroundColor: '#fafafa'}}
dropDownStyle={{backgroundColor: '#fafafa'}}
onChangeItem={item => this.setState({
country: item.value
})}
/>
</View>
<Text>Value: {this.state.country}</Text>
<Text>Some other text </Text>
<Text>Some other text </Text>
<Text>Some other text </Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
paddingTop: Constants.statusBarHeight,
backgroundColor: '#ecf0f1',
padding: 8,
}
});
from react-native-dropdown-picker.
@sandeepg1220
It's working fine, or did i miss anything?
from react-native-dropdown-picker.
Not able to select france country
from react-native-dropdown-picker.
from react-native-dropdown-picker.
https://snack.expo.io/@hossein-zare/change-value-example (Updated)
Nested Views
You have to add zIndex to the nested views which contain the picker.
Note! zIndex locks the picker on Android, The solution is to use the Platform.OS
https://github.com/hossein-zare/react-native-dropdown-picker#zindex-conflicts-untouchable-items-overlapping-pickers
from react-native-dropdown-picker.
Ok now it's perfect. How to achieve when user click on anywhere in the screen the opened drop down has to close.
from react-native-dropdown-picker.
@sandeepg1220
#29
https://snack.expo.io/@hossein-zare/touch-outside
from react-native-dropdown-picker.
Related Issues (20)
- Searching and updating Item Issue
- modalTitleStyle being overwritten
- Can't select item in multi choices when search text input is focused and keyboard open HOT 1
- Not switching DarkMode when rendered
- overriding the ui HOT 3
- If i do truncated string so why the left string is not getting for the search result.
- if i delete string from the back so i did not get data HOT 1
- Changing Icon Color "tintColor" gives error HOT 2
- Custom Value after clicking the dropdown items.
- Search string in Searchable picker is not cleared
- Picker should have Label option
- "loading" is not working when "addCustomItem" is set to true.
- How to update the colour of view separator
- dropdown list conflict with below View HOT 5
- search and label fields HOT 1
- When in landscape mode, the dropdown can appear off screen
- Accessibility Issues
- react-native-gesture-handler dependency resolution issues
- measureInWindow returns wrong value on Android
- Light Icons Parsing Error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-dropdown-picker.