Skip to content

Commit 270f29a

Browse files
authored
Merge pull request #462 from tbl0605/bug-453
2 parents f0a7744 + edc733b commit 270f29a

File tree

6 files changed

+41
-28
lines changed

6 files changed

+41
-28
lines changed

dist/cjs.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ function _await(value, then, direct) {
6565
var result = body();if (result && result.then) {
6666
return result.then(_empty);
6767
}
68-
}function _catch(body, recover) {
68+
}
69+
function _catch(body, recover) {
6970
try {
7071
var result = body();
7172
} catch (e) {
@@ -528,17 +529,23 @@ function _await(value, then, direct) {
528529
}
529530
},
530531
suggestionClick: function suggestionClick(suggestion, e) {
532+
var _this8 = this;
533+
531534
this.$emit('suggestion-click', suggestion, e);
532535
this.select(suggestion);
533536

534537
if (!this.preventHide) this.hideList();
535538

536-
/// Ensure, that all needed flags are off before finishing the click.
537-
this.isClicking = false;
539+
if (this.isClicking) {
540+
setTimeout(function () {
541+
_this8.inputElement.focus();
542+
543+
/// Ensure, that all needed flags are off before finishing the click.
544+
_this8.isClicking = false;
545+
}, 0);
546+
}
538547
},
539548
onBlur: function onBlur(e) {
540-
var _this8 = this;
541-
542549
if (this.isInFocus) {
543550

544551
/// Clicking starts here, because input's blur occurs before the suggestionClick
@@ -552,9 +559,6 @@ function _await(value, then, direct) {
552559
this.$emit('blur', e);
553560
} else if (e && e.isTrusted && !this.isTabbed) {
554561
this.isFalseFocus = true;
555-
setTimeout(function () {
556-
_this8.inputElement.focus();
557-
}, 0);
558562
}
559563
} else {
560564
this.inputElement.blur();

dist/es6.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ function _await(value, then, direct) {
5959
var result = body();if (result && result.then) {
6060
return result.then(_empty);
6161
}
62-
}function _catch(body, recover) {
62+
}
63+
function _catch(body, recover) {
6364
try {
6465
var result = body();
6566
} catch (e) {
@@ -499,8 +500,14 @@ function _await(value, then, direct) {
499500

500501
if (!this.preventHide) this.hideList();
501502

502-
/// Ensure, that all needed flags are off before finishing the click.
503-
this.isClicking = false;
503+
if (this.isClicking) {
504+
setTimeout(() => {
505+
this.inputElement.focus();
506+
507+
/// Ensure, that all needed flags are off before finishing the click.
508+
this.isClicking = false;
509+
}, 0);
510+
}
504511
},
505512
onBlur(e) {
506513
if (this.isInFocus) {
@@ -516,9 +523,6 @@ function _await(value, then, direct) {
516523
this.$emit('blur', e);
517524
} else if (e && e.isTrusted && !this.isTabbed) {
518525
this.isFalseFocus = true;
519-
setTimeout(() => {
520-
this.inputElement.focus();
521-
}, 0);
522526
}
523527
} else {
524528
this.inputElement.blur();
@@ -546,8 +550,7 @@ function _await(value, then, direct) {
546550
}
547551

548552
this.isFalseFocus = false;
549-
},
550-
onInput(inputEvent) {
553+
}, onInput(inputEvent) {
551554
const value = !inputEvent.target ? inputEvent : inputEvent.target.value;
552555

553556
this.updateTextOutside(value);

dist/es7.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,14 @@ var VueSimpleSuggest = {
445445

446446
if (!this.preventHide) this.hideList();
447447

448-
/// Ensure, that all needed flags are off before finishing the click.
449-
this.isClicking = false;
448+
if (this.isClicking) {
449+
setTimeout(() => {
450+
this.inputElement.focus();
451+
452+
/// Ensure, that all needed flags are off before finishing the click.
453+
this.isClicking = false;
454+
}, 0);
455+
}
450456
},
451457
onBlur(e) {
452458
if (this.isInFocus) {
@@ -462,9 +468,6 @@ var VueSimpleSuggest = {
462468
this.$emit('blur', e);
463469
} else if (e && e.isTrusted && !this.isTabbed) {
464470
this.isFalseFocus = true;
465-
setTimeout(() => {
466-
this.inputElement.focus();
467-
}, 0);
468471
}
469472
} else {
470473
this.inputElement.blur();

dist/iife.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/vue-simple-suggest.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,14 @@ export default {
469469
470470
if (!this.preventHide) this.hideList()
471471
472-
/// Ensure, that all needed flags are off before finishing the click.
473-
this.isClicking = false
472+
if (this.isClicking) {
473+
setTimeout(() => {
474+
this.inputElement.focus()
475+
476+
/// Ensure, that all needed flags are off before finishing the click.
477+
this.isClicking = false
478+
}, 0)
479+
}
474480
},
475481
onBlur (e) {
476482
if (this.isInFocus) {
@@ -486,9 +492,6 @@ export default {
486492
this.$emit('blur', e)
487493
} else if (e && e.isTrusted && !this.isTabbed) {
488494
this.isFalseFocus = true
489-
setTimeout(() => {
490-
this.inputElement.focus()
491-
}, 0)
492495
}
493496
} else {
494497
this.inputElement.blur()

0 commit comments

Comments
 (0)