I have a drop down menu in a Vue application utilizing ElementUI which I need to explicitly close after applying some logic.
Essentially the flow is:
At this point, if the user confirms their choice, the new name gets written to the database, but the drop down stays open. I need to add some logic to call after the user confirms their choice in step 2 to ensure that the drop down doesn't stay open.
<div class="part">
<span class="for-label"> Employee: </span>
<el-select v-model="dataValue.assignedUser" filterable :disabled="notClick" @change="handle">
<el-option
v-for="(user, userIndex) in assignedOption"
:key="userIndex"
:label="user.userName"
:value="user.userEmail"
/>
</el-select>
</div>
If relevant this bug only started occurring after adding the "filterable" attribute to the el-select.
I don't know why it would stay open, but you should be able to close it by calling its blur
function.
add ref to the select and call the following when it should close.
this.$refs.select.blur()