2
0
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:
Steven Harman
2018-07-18 00:39:09 -04:00
parent e926b6e007
commit a5555a6c6a
+3 -2
View File
@@ -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 {