Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

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
Collaborator

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants