Skip to content

Commit 2d5aff2

Browse files
committed
fix stuck focus
1 parent 16291a4 commit 2d5aff2

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lib/vue-simple-suggest.vue

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
role="listbox"
2020
:aria-labelledby="listId"
2121
:class="styles.suggestions"
22-
@mouseenter="hoverList(true)"
23-
@mouseleave="hoverList(false)"
2422
>
2523
<li v-if="!!this.$scopedSlots['misc-item-above']">
2624
<slot name="misc-item-above"
@@ -181,7 +179,6 @@ export default {
181179
text: this.value,
182180
isPlainSuggestion: false,
183181
isClicking: false,
184-
isOverList: false,
185182
isInFocus: false,
186183
isFalseFocus: false,
187184
isTabbed: false,
@@ -354,9 +351,6 @@ export default {
354351
355352
this.hovered = item
356353
},
357-
hoverList (isOverList) {
358-
this.isOverList = isOverList
359-
},
360354
hideList () {
361355
if (this.listShown) {
362356
this.listShown = false
@@ -457,14 +451,14 @@ export default {
457451
this.hideList()
458452
459453
/// Ensure, that all needed flags are off before finishing the click.
460-
this.isClicking = this.isOverList = false
454+
this.isClicking = false
461455
},
462456
onBlur (e) {
463457
if (this.isInFocus) {
464458
465459
/// Clicking starts here, because input's blur occurs before the suggestionClick
466460
/// and exactly when the user clicks the mouse button or taps the screen.
467-
this.isClicking = this.isOverList && !this.isTabbed
461+
this.isClicking = this.hovered && !this.isTabbed
468462
469463
if (!this.isClicking) {
470464
this.isInFocus = false

0 commit comments

Comments
 (0)