2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00

Only ignore searchBlur while mouse is down (#787)

This maintains the existing functionality in IE11 but in modern browsers allows the options to be dismissed by clicking outside the options
This commit is contained in:
Hamish Robertson
2019-03-22 17:37:28 +00:00
committed by Jeff Sagal
parent bda47806d3
commit d834f2c993
+5 -1
View File
@@ -369,7 +369,7 @@
</div>
<transition :name="transition">
<ul ref="dropdownMenu" v-if="dropdownOpen" class="dropdown-menu" :style="{ 'max-height': maxHeight }" role="listbox" @mousedown="onMousedown">
<ul ref="dropdownMenu" v-if="dropdownOpen" class="dropdown-menu" :style="{ 'max-height': maxHeight }" role="listbox" @mousedown="onMousedown" @mouseup="onMouseup">
<li role="option" v-for="(option, index) in filteredOptions" v-bind:key="index" :class="{ active: isOptionSelected(option), highlight: index === typeAheadPointer }" @mouseover="typeAheadPointer = index">
<a @mousedown.prevent.stop="select(option)">
<slot name="option" v-bind="(typeof option === 'object')?option:{[label]: option}">
@@ -1076,6 +1076,10 @@
*/
onMousedown() {
this.mousedown = true
},
onMouseup() {
this.mousedown = false
}
},