Skip to content

Commit a5555a6

Browse files
committed
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.
1 parent e926b6e commit a5555a6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/Select.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@
329329
<div :dir="dir" class="dropdown v-select" :class="dropdownClasses">
330330
<div ref="toggle" @mousedown.prevent="toggleDropdown" class="dropdown-toggle clearfix">
331331

332-
<div class="v-select__selected-options">
332+
<div class="v-select__selected-options" ref="selectedOptions">
333333
<slot v-for="option in valueAsArray" name="selected-option-container"
334334
:option="(typeof option === 'object')?option:{[label]: option}" :deselect="deselect" :multiple="multiple" :disabled="disabled">
335335
<span class="selected-tag" v-bind:key="option.index">
@@ -856,7 +856,8 @@
856856
* @return {void}
857857
*/
858858
toggleDropdown(e) {
859-
if (e.target === this.$refs.openIndicator || e.target === this.$refs.search || e.target === this.$refs.toggle || e.target === this.$el) {
859+
if (e.target === this.$refs.openIndicator || e.target === this.$refs.search || e.target === this.$refs.toggle ||
860+
e.target === this.$refs.selectedOptions || e.target === this.$el) {
860861
if (this.open) {
861862
this.$refs.search.blur() // dropdown will close on blur
862863
} else {

0 commit comments

Comments
 (0)