Giter Site home page Giter Site logo

Comments (12)

hossein-zare avatar hossein-zare commented on August 17, 2024

Hello, Please edit your issue.

from react-native-dropdown-picker.

sandeepg1220 avatar sandeepg1220 commented on August 17, 2024

Unable to select the dropdown values

from react-native-dropdown-picker.

hossein-zare avatar hossein-zare commented on August 17, 2024

Others haven't faced the issue, Please add your Code Snippet.

from react-native-dropdown-picker.

sandeepg1220 avatar sandeepg1220 commented on August 17, 2024
<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.

hossein-zare avatar hossein-zare commented on August 17, 2024

@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.

sandeepg1220 avatar sandeepg1220 commented on August 17, 2024

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.

hossein-zare avatar hossein-zare commented on August 17, 2024

@sandeepg1220
It's working fine, or did i miss anything?

from react-native-dropdown-picker.

sandeepg1220 avatar sandeepg1220 commented on August 17, 2024

Not able to select france country

from react-native-dropdown-picker.

sandeepg1220 avatar sandeepg1220 commented on August 17, 2024

Screenshot 2020-06-26 at 2 12 25 PM

from react-native-dropdown-picker.

hossein-zare avatar hossein-zare commented on August 17, 2024

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

#19

from react-native-dropdown-picker.

sandeepg1220 avatar sandeepg1220 commented on August 17, 2024

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.

hossein-zare avatar hossein-zare commented on August 17, 2024

@sandeepg1220
#29
https://snack.expo.io/@hossein-zare/touch-outside

from react-native-dropdown-picker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.