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

Support option clear in select #21

Open
Binh-NA opened this issue Jan 4, 2021 · 1 comment
Open

Support option clear in select #21

Binh-NA opened this issue Jan 4, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@Binh-NA
Copy link

Binh-NA commented Jan 4, 2021

  • only show clear (X) when have value
    image
@thien-do
Copy link
Owner

thien-do commented Mar 31, 2021

This is a little bit complicated actually... the type of a Select's value is strictly defined by the consumer, so as library's author we wouldn't know if clicking on "X" should reset the value to "null", "undefined" or something else.

To support this, we should have an explicit prop:

interface SelectProps<T> {
  value?: T;
  reset?: T; // same type of option values
}

but it would be a little bit confusing, as the user may want to reset the value to "undefined" and we can't compare that with when the user doesn't want a reset value.

Need to think about this more

@lqt93 lqt93 added the enhancement New feature or request label Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants