mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-10 07:52:23 +03:00
Toggle dropdown when mousedown in "empty space"
We might have "empty" space w/in the select box, but outside of the input. In that case, we still want to toggle the dropdown when clicking on that "empty" space.
This commit is contained in:
@@ -329,7 +329,7 @@
|
||||
<div :dir="dir" class="dropdown v-select" :class="dropdownClasses">
|
||||
<div ref="toggle" @mousedown.prevent="toggleDropdown" class="dropdown-toggle clearfix">
|
||||
|
||||
<div class="v-select__selected-options">
|
||||
<div class="v-select__selected-options" ref="selectedOptions">
|
||||
<slot v-for="option in valueAsArray" name="selected-option-container"
|
||||
:option="(typeof option === 'object')?option:{[label]: option}" :deselect="deselect" :multiple="multiple" :disabled="disabled">
|
||||
<span class="selected-tag" v-bind:key="option.index">
|
||||
@@ -856,7 +856,8 @@
|
||||
* @return {void}
|
||||
*/
|
||||
toggleDropdown(e) {
|
||||
if (e.target === this.$refs.openIndicator || e.target === this.$refs.search || e.target === this.$refs.toggle || e.target === this.$el) {
|
||||
if (e.target === this.$refs.openIndicator || e.target === this.$refs.search || e.target === this.$refs.toggle ||
|
||||
e.target === this.$refs.selectedOptions || e.target === this.$el) {
|
||||
if (this.open) {
|
||||
this.$refs.search.blur() // dropdown will close on blur
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user