Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

0 value is mistakenly skipped in item validation #250

@KubaJastrz

Description

@KubaJastrz

selectivity v3.1.0
react v16.4.1

When I create an item list like this:

const items = [
    { id: -1, text: "-1 -- works" },
    { id: 0, text: "0 -- doesn't work" },
    { id: 1, text: "1 -- works" },
    { id: "-1", text: "'-1' -- works" },
    { id: "0", text: "'0' -- works" },
    { id: "1", text: "'1' -- works" }
];

And pass it down to Selectivity component:

<Selectivity.React items={items} />

Value of 0 is not properly recognized as a valid item in the dropdown menu.

I've also made a live example, so you can see it better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions