Keen-UI
Keen-UI copied to clipboard
UiSelect improvements
This is a proposal PR handling an issue I've long had in our project.
- 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. #285 #270
- 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. #446 #406
- 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.