Skip to content

UiSelect improvements#557

Open
kilobyte2007 wants to merge 5 commits intoJosephusPaye:nextfrom
kilobyte2007:ui-select-improvement
Open

UiSelect improvements#557
kilobyte2007 wants to merge 5 commits intoJosephusPaye:nextfrom
kilobyte2007:ui-select-improvement

Conversation

@kilobyte2007
Copy link
Contributor

This is a proposal PR handling an issue I've long had in our project.

  1. UiSelect to emit only the value and not the whole object up. This is more and more relevant considering the way modern apps work where you have a list of options but only store the value in your database, without the label. I know it's a very breaking change but it seems like it would be the correct way forward. Most other UI libraries do it this way and it seems much more logical. UiSelect - Select option by value #285 UISelect is not returning the pure value #270
  2. Added a clear button to UiSelect - allowing it to clear the value (similarly to the way UiAutocomplete works). It can be configured using a prop. I've also added it to the UiDatepicker component as it also didn't have a way of clearing the value out of the box. Also, I've added support for a null value for the UiSelect - this way we can have null values coming from the database and the UiSelect won't turn them into a String automatically. How can we select an empty value? #446 Clearing the selection in UiSelect #406
  3. Added support to providing UiSelect options as an object - just a QOL improvement as very often it's much easier to provide the options like this: `{ 1: 'Sergiu', 2: 'Tom', 3: 'John' }.

We already use all of these in our production apps by linking to a forked branch and it helped me remove so much redundant code so I would really be glad if this landed. Let me know what you think.

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

Successfully merging this pull request may close these issues.

1 participant