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

Not possible to define placeholder #11

Open
klapperkopp opened this issue Apr 26, 2018 · 0 comments
Open

Not possible to define placeholder #11

klapperkopp opened this issue Apr 26, 2018 · 0 comments

Comments

@klapperkopp
Copy link

klapperkopp commented Apr 26, 2018

I'd like to define a placeholder item, in case there is no value selected upfront.
This doesn't seem to work.

At the moment I solve this by adding a placeholder item into my array first and then not rendering a selection option for it, when opening the Picker Items.

categories: [
                {id: 0, name: 'Choose a category'},
                {id: 1, name: 'Art'},
                {id: 2, name: 'Music'}
            ],
{_.filter(categories, cat => cat.id != 0).map(cat =>
    <Picker.Item
        key={cat.id}
        label={cat.name}
        value={cat.id}
    />
)}

Is there any other way that is better?

I would like something like just setting the placeholder via the placeholder prop on the Picker, or just use the already existing prompt prop on the picker to display this.

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

1 participant