-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Event for clearable #1429
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
Comments
+1 |
2 similar comments
+1 |
+1 |
I solved this with patch-package. Replace node_module/vue-select/dist/vue-select.js for this content vue-select.js and apply a new patch. Usage: <v-select
...
@option:clear="onClear"
/> |
Or you can resolve this in a more elegant way. in your view <v-select
:components="{Deselect}"
/> in your vue or component. I'm currently using in a component. ...
data() {
return {
Deselect: {
render: (createElement) => {
return createElement('span', {
on: {
click: ()=>{
this.$emit('deselect',this);
}
}
},'❌');
}
}
}
... Then you can mount a listener for example in the created state. created(){
this.$on('deselect',this.someMethod);
}, |
I realize there are possible work arounds, so thanks to those who commented. but it just strikes me as odd that a component exposes an "X" button that you can click, wouldn't expose a custom event to listen for that button click. |
yeah, me too 😩. That's why I'm doing this way. It will be updated once available without yet including another package. As you just saw, you're not alone in this topic 😆 |
I also need this :) |
any solutions |
better create PR for this |
@sagalbot Please pay attention |
Is this fix added to the current package yet? |
+1 |
1 similar comment
+1 |
One year later, using the same component in another project and still don't have this event :(
usage:
|
thanks @itlpps it works, but console gave me a warning like this : "option:cleared" but it is neither declared in the emits option nor as an "onOption:cleared" prop. How to fix this by the way? |
+1 |
Since we don't have an explicit event yet, pasting the snippet of the workaround I used.
|
@clear="handleQuery" |
Any update here? |
3 similar comments
Any update here? |
Any update here? |
Any update here? |
Uh oh!
There was an error while loading. Please reload this page.
I want get an event when click on "x" for clear, please
The text was updated successfully, but these errors were encountered: