2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-19 09:50:33 +03:00

fix: use click instead of mousedown event, fixes iOS bug (#1248)

Thanks to @PieterWigboldus for originally reporting in #814 and fixing in #815.

Co-authored-by: Jeff Sagal <sagalbot@gmail.com>
This commit is contained in:
HckrNews
2021-08-23 22:50:06 +02:00
committed by GitHub
parent c8571c1504
commit 58905e1659
3 changed files with 5 additions and 11 deletions
+1 -1
View File
@@ -109,7 +109,7 @@
}" }"
:aria-selected="index === typeAheadPointer ? true : null" :aria-selected="index === typeAheadPointer ? true : null"
@mouseover="selectable(option) ? (typeAheadPointer = index) : null" @mouseover="selectable(option) ? (typeAheadPointer = index) : null"
@mousedown.prevent.stop="selectable(option) ? select(option) : null" @click.prevent.stop="selectable(option) ? select(option) : null"
> >
<slot name="option" v-bind="normalizeOptionForSlot(option)"> <slot name="option" v-bind="normalizeOptionForSlot(option)">
{{ getOptionLabel(option) }} {{ getOptionLabel(option) }}
+2 -8
View File
@@ -6,10 +6,7 @@
clear: both; clear: both;
color: #333; /* Overrides most CSS frameworks */ color: #333; /* Overrides most CSS frameworks */
white-space: nowrap; white-space: nowrap;
cursor: pointer;
&:hover {
cursor: pointer;
}
} }
.vs__dropdown-option--highlight { .vs__dropdown-option--highlight {
@@ -20,8 +17,5 @@
.vs__dropdown-option--disabled { .vs__dropdown-option--disabled {
background: inherit; background: inherit;
color: $vs-state-disabled-color; color: $vs-state-disabled-color;
cursor: inherit;
&:hover {
cursor: inherit;
}
} }
+2 -2
View File
@@ -10,7 +10,7 @@ describe('Selectable prop', () => {
Select.vm.$data.open = true Select.vm.$data.open = true
await Select.vm.$nextTick() await Select.vm.$nextTick()
Select.find('.vs__dropdown-menu li:first-child').trigger('mousedown') Select.find('.vs__dropdown-menu li:first-child').trigger('click')
await Select.vm.$nextTick() await Select.vm.$nextTick()
expect(Select.vm.selectedValue).toEqual(['one']) expect(Select.vm.selectedValue).toEqual(['one'])
@@ -25,7 +25,7 @@ describe('Selectable prop', () => {
Select.vm.$data.open = true Select.vm.$data.open = true
await Select.vm.$nextTick() await Select.vm.$nextTick()
Select.find('.vs__dropdown-menu li:last-child').trigger('mousedown') Select.find('.vs__dropdown-menu li:last-child').trigger('click')
await Select.vm.$nextTick() await Select.vm.$nextTick()
expect(Select.vm.selectedValue).toEqual([]) expect(Select.vm.selectedValue).toEqual([])