Skip to content

Commit 744c52a

Browse files
authored
Merge pull request #298 from shrpne/fix-focus-stuck
fix stuck focus
2 parents 607695b + 2d5aff2 commit 744c52a

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,
@@ -360,9 +357,6 @@ export default {
360357
361358
this.hovered = item
362359
},
363-
hoverList (isOverList) {
364-
this.isOverList = isOverList
365-
},
366360
hideList () {
367361
if (this.listShown) {
368362
this.listShown = false
@@ -463,14 +457,14 @@ export default {
463457
this.hideList()
464458
465459
/// Ensure, that all needed flags are off before finishing the click.
466-
this.isClicking = this.isOverList = false
460+
this.isClicking = false
467461
},
468462
onBlur (e) {
469463
if (this.isInFocus) {
470464
471465
/// Clicking starts here, because input's blur occurs before the suggestionClick
472466
/// and exactly when the user clicks the mouse button or taps the screen.
473-
this.isClicking = this.isOverList && !this.isTabbed
467+
this.isClicking = this.hovered && !this.isTabbed
474468
475469
if (!this.isClicking) {
476470
this.isInFocus = false

0 commit comments

Comments
 (0)