-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 with disabled property #309
Conversation
1, Add support for options with disabled property 2, Add corresponding test case and demo
This is great. +1 for merging this request. |
@markselby9 thanks for the contribution! I think this is an important feature, but the implementation needs to be a bit more abstract. The component needs to remain as agnostic of the data source as possible. Perhaps there are options that need to be disabled, but the |
1. Add a custom disabled key 2. Modify the demo for this feature
# Conflicts: # src/components/Select.vue
@sagalbot |
Any timeline for when this gets merged and released? |
Same question : When will this be available ? |
@sagalbot Do you need any help with merge this in master branch? |
To anybody that need to use this feature I create fork and merge this pull request. |
I'd also love to see this feature merged. Could use it right now! :) |
Has anyone looked at this merge conflict recently? This is a useful feature, I hate to see issues in PRgatory. Also it is Hacktoberfest right now, this could help resolve this easily. |
Here is I merge it |
@sagalbot any chance this gets merged soon? It is an useful feature. |
It was in 2018 :( |
Sorry for the long wait on this one, it's definitely one that should get in. The most recent changes are definitely a step in the right direction. For v3, I've removed the Thinking more about this, I think the best option is perhaps a single selectable: {
type: Function,
default: option => true,
}, This function would determine wether the Internally, this function would always be evaluated as a boolean. This provides a pretty basic, but powerful API. If your data set happens to have a disabled key, you'd implement as such: <v-select :selectable="option => ! option.disabled" /> It's only a few more words to type than specifying an object key, but it'd also support more complex situations. For example, a list of people that you can select. In this case, you should only be able to select people that are above the age of 20. <v-select :selectable="person => person.age >= 20" /> Or perhaps your disable key is deeply nested in an object: <v-select :selectable="option => ! option.meta.isDisabled" /> It would also work with primitives: <v-select :options="[1,2,3,4,5]" :selectable="num => num < 3" /> This approach means that |
Related: #803 |
|
Agree that the |
any progress on this? |
any progress on this? @sagalbot pliss? |
@wilian746 see #921 for an initial implementation - feel free to test and report back your findings ( |
Closing in favor of the |
1, Add support for options with disabled property
2, Add corresponding test case and demo
issue reference: #104