mirror of
https://github.com/tenrok/vue-select.git
synced 2026-05-17 02:29:37 +03:00
Fix #106
This commit is contained in:
@@ -5,3 +5,4 @@ npm-debug.log
|
||||
test/unit/coverage
|
||||
.coveralls.yml
|
||||
.flowconfig
|
||||
package-lock.json
|
||||
|
||||
@@ -324,9 +324,9 @@
|
||||
</div>
|
||||
|
||||
<transition :name="transition">
|
||||
<ul ref="dropdownMenu" v-if="dropdownOpen" class="dropdown-menu" :style="{ 'max-height': maxHeight }">
|
||||
<ul ref="dropdownMenu" v-if="dropdownOpen" class="dropdown-menu" :style="{ 'max-height': maxHeight }" @mousedown="onMousedown">
|
||||
<li v-for="(option, index) in filteredOptions" v-bind:key="index" :class="{ active: isOptionSelected(option), highlight: index === typeAheadPointer }" @mouseover="typeAheadPointer = index">
|
||||
<a @mousedown.prevent="select(option)">
|
||||
<a @mousedown.prevent.stop="select(option)">
|
||||
<slot name="option" v-bind="option">
|
||||
{{ getOptionLabel(option) }}
|
||||
</slot>
|
||||
@@ -766,11 +766,16 @@
|
||||
* @return {void}
|
||||
*/
|
||||
onSearchBlur() {
|
||||
if (this.clearSearchOnBlur) {
|
||||
this.search = ''
|
||||
if (this.mousedown) {
|
||||
this.$refs.search.focus()
|
||||
this.mousedown = false
|
||||
} else {
|
||||
if (this.clearSearchOnBlur) {
|
||||
this.search = ''
|
||||
}
|
||||
this.open = false
|
||||
this.$emit('search:blur')
|
||||
}
|
||||
this.open = false
|
||||
this.$emit('search:blur')
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -826,6 +831,17 @@
|
||||
if (this.pushTags) {
|
||||
this.mutableOptions.push(option)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Event-Handler to help workaround IE11 (probably fixes 10 as well)
|
||||
* firing a `blur` event when clicking
|
||||
* the dropdown's scrollbar, causing it
|
||||
* to collapse abruptly.
|
||||
* @return {void}
|
||||
*/
|
||||
onMousedown() {
|
||||
this.mousedown = true
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user