mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-19 09:50:33 +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:
committed by
Jeff Sagal
parent
bda47806d3
commit
d834f2c993
@@ -369,7 +369,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<transition :name="transition">
|
<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">
|
<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)">
|
<a @mousedown.prevent.stop="select(option)">
|
||||||
<slot name="option" v-bind="(typeof option === 'object')?option:{[label]: option}">
|
<slot name="option" v-bind="(typeof option === 'object')?option:{[label]: option}">
|
||||||
@@ -1076,6 +1076,10 @@
|
|||||||
*/
|
*/
|
||||||
onMousedown() {
|
onMousedown() {
|
||||||
this.mousedown = true
|
this.mousedown = true
|
||||||
|
},
|
||||||
|
|
||||||
|
onMouseup() {
|
||||||
|
this.mousedown = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user