Code Monkey home page Code Monkey logo

react-native-select-picker's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-native-select-picker's Issues

Issue when parsing value={null}

When having an<SelectPicker.Item with the value null and and parsing a value 0 as value in one of the other fields the Item with the null value is being selected

<SelectPicker
    selected={0}
>
    <SelectPicker.Item label="Select none" value={null} /> /* THIS WILL VE SELECTED */
    <SelectPicker.Item label="option #1" value={0} />
    <SelectPicker.Item label="option #2" value={1} />
    <SelectPicker.Item label="option #3" value={2} />
</SelectPicker>

Expected behaviour

When parsing any as selected the Item with the value matching the value of selected should be picked.

Eg:

  1. parsing selected={0} should select the item with the value={0}
  2. parsing selected={1} should select the item with the value={1}
  3. parsing selected={null} should select the item with the value={null}

As a temporary solution i moved the Select none to the bottom of the list

Issue for value equal to 0

I don't know if this is some implementation detail but when having a <SelectPicker> with default value selected equal to zero, the corresponding item is not automatically selected. This is not happening for other values.

<SelectPicker
    selected={0}
>
    <SelectPicker.Item label="option #1" value={0} /> // It is not being selected automatically 
    <SelectPicker.Item label="option #2" value={1} />
    <SelectPicker.Item label="option #3" value={2} />
</SelectPicker>

Expected behavior

When it is set to zero, it should select the corresponding item

Notes

My solution for now is to use selected with a default value being a string and for some reason that works.

Supporting dark mode

Hi,

In our app we have several forms. These are built using the native TextInput component, react-native-date-picker and this package.

Other then the other components, this component seems to not support dark mode (at least for iOS) and the picker remains light even if dark mode is active.

Below is an example of the date picker component with dark mode enabled:

Or is there something (a property) I am missing? If not, are there any plans to support dark mode in the future?

Kind regard,
Geert van Soest

Using key as a property like the example triggers a warning

Current behavior

I am trying to set the key property for SelecPicker.Item as in the example but got the following warning:
imagen
Checking out the code, as expected, there is no key props attribute so that's why the error is triggered.

Expected behavior

When setting a key for the SelectPicker.Item, no warning should appear.

Notes

I tried creating a React.Fragment enclosing the SelectPicker.Item but it doesn't show as an option anymore. Therefore it appears that there is no current solution.

Invariant Violation: Tried to register two views with the same name

Hi,
I tried the plugin but I'm getting:
Invariant Violation: Tried to register two views with the same name RNCAndroidDropdownPicker

"react-native": "0.63.4",
"react-native-form-select-picker": "0.0.10",

Edit:
Resolved, the issue was related to some deprecated import in the plugin core.

Solution:

Edit node_modules\react-native-form-select-picker\src\index.js and node_modules\react-native-form-select-picker\src\components\picketitem-native.js

replace:
import { Picker } from '@react-native-community/picker';
by
import { Picker } from '@react-native-picker/picker';

you can edit the package.json too

Is there any option to disable default placeholder?

My app was messed up after updating the version to 62.2. And I found this package which is really great and helped me to save time on this.

Thank you for all the work you have done for this.

I'm just wondering if there's an option to disable default placeholder? I set default value instead of this placeholder so don't' want to list default placeholder as an option.

e.g:
------select-----
option1
option2
option3

TO

option1
option2
option3

Please advise.

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.