Answer the question
In order to leave comments, you need to log in
How to make an event on tab outside of the component?
I have a question such that, let's say, when I passed from the input by pressing tab, then everything works fine, but if you press tab again, then you need the event to fire on the closing of the select. Approximately how to do this? https://codesandbox.io/s/3v1zp6x1w1
Here is the code but set in document tab event but it works
methods: {
closeOptionTab(e) {
if (this.$refs['selected'].contains(e.target)) {
return;
}
if (this.disabled) {
this.disabled = false;
}
}
},
created() {
document.addEventListener("tab", this.closeOptionTab)
}
<input
@keyup.tab="disabled = true"
type="text"
class="field-form"
:value="name"
@click="onClick"
:placeholder="inputPlaceholder"
/>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question