Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when parsing value={null} #6

Open
arelstone opened this issue Jul 31, 2020 · 1 comment
Open

Issue when parsing value={null} #6

arelstone opened this issue Jul 31, 2020 · 1 comment

Comments

@arelstone
Copy link
Contributor

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

@olayinkaokewale
Copy link
Owner

Thanks for the notice. Did you try it with any other value? Did it work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants