Skip to content

Commit d834f2c

Browse files
hrobertsonsagalbot
authored andcommitted
Only ignore searchBlur while mouse is down (sagalbot#787)
This maintains the existing functionality in IE11 but in modern browsers allows the options to be dismissed by clicking outside the options
1 parent bda4780 commit d834f2c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/Select.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369
</div>
370370

371371
<transition :name="transition">
372-
<ul ref="dropdownMenu" v-if="dropdownOpen" class="dropdown-menu" :style="{ 'max-height': maxHeight }" role="listbox" @mousedown="onMousedown">
372+
<ul ref="dropdownMenu" v-if="dropdownOpen" class="dropdown-menu" :style="{ 'max-height': maxHeight }" role="listbox" @mousedown="onMousedown" @mouseup="onMouseup">
373373
<li role="option" v-for="(option, index) in filteredOptions" v-bind:key="index" :class="{ active: isOptionSelected(option), highlight: index === typeAheadPointer }" @mouseover="typeAheadPointer = index">
374374
<a @mousedown.prevent.stop="select(option)">
375375
<slot name="option" v-bind="(typeof option === 'object')?option:{[label]: option}">
@@ -1076,6 +1076,10 @@
10761076
*/
10771077
onMousedown() {
10781078
this.mousedown = true
1079+
},
1080+
1081+
onMouseup() {
1082+
this.mousedown = false
10791083
}
10801084
},
10811085

0 commit comments

Comments
 (0)