Skip to content

Commit

Permalink
Only ignore searchBlur while mouse is down (#787)
Browse files Browse the repository at this point in the history
This maintains the existing functionality in IE11 but in modern browsers allows the options to be dismissed by clicking outside the options
  • Loading branch information
hrobertson authored and sagalbot committed Mar 22, 2019
1 parent bda4780 commit d834f2c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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}">
Expand Down Expand Up @@ -1076,6 +1076,10 @@
*/
onMousedown() {
this.mousedown = true
},
onMouseup() {
this.mousedown = false
}
},
Expand Down

0 comments on commit d834f2c

Please sign in to comment.