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

OptionType doesn't describe what it accepts #5894

Open
tswaters opened this issue Apr 19, 2024 · 0 comments
Open

OptionType doesn't describe what it accepts #5894

tswaters opened this issue Apr 19, 2024 · 0 comments
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet

Comments

@tswaters
Copy link

This is more of a documentation bug than anything else, although maybe there's a bug in here somewhere. This shows up in the "OptionType":

type OptionType = { [string]: any }

Which is a pojo, anything goes. And while you can provide any object, I found there was some weirdness.

When I used the select with an array of objects looking like {id, name}, after I selected an option every option turned blue... Once I refreshed the page, it would go back to normal. I'm using HMR so needed to refresh the page a lot.

It look me a while to figure out how to keep the menu open, then that the applied classes on my blue entries correspond to something being selected -- so selecting one item selected all of them? Weird.

Looking through some of the examples that people have used, I started passing {label, value} in addition to custom properties and sure enough, once value was present, the issue went away.

Seems to me the type for OptionType should explicitly list value if it's required for functionality.

@tswaters tswaters added the issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet
Projects
None yet
Development

No branches or pull requests

1 participant