-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
CMultiSelect should have value
property
#428
Comments
@niksajanjic I will check |
@mrholek Please also check the vue-pro package, as the same issue occurs there. |
Has anyone figured out a workaround for this? |
@niksajanjic @igoohd @errolNOTRS It will be added in one of the releases next month. |
@mrholek That's great news! Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is PRO feature, but I don't have access to PRO repo therefore I created the issue here:
I think
CMultiSelect
should havevalue
property just like any other form element.CDatePicker
hasdate
attribute, so I'm not concentrated on the name, but the ability to set the current value of the form component. Without that, this component is complicated to be implemented as controlled component.The way it works at the moment is that we send
options
which can haveselected
property. That means, if we want to have a controlled component, we need to updateoptions
on everyonChange
or listen tovalue
which can be updated from somewhere else and update selectedoptions
. That looks quite weird in my opinion.I would expect the functionality to be more like this:
The type of
selected
fromonChange
can always be an array, even when we select only one option. It should be internal logic of the component to calculate which options are selected from providedoptions
andvalue
. Also,value
could have nested arrays that would correspond to nestedoptions
.Similar component exist in Ant Design and it has
value
:https://ant.design/components/select
Also in Material UI, but they divided
Select
andAutocomplete
components into 2 different ones, both havevalue
:https://mui.com/material-ui/api/autocomplete/
The text was updated successfully, but these errors were encountered: