Skip to content

Commit 731f146

Browse files
committed
rework initial patch
1 parent e15c41f commit 731f146

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

dist/cjs.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ var VueSimpleSuggest = {
652652
_this12.$emit('request-start', value);
653653
}
654654

655-
_this12.isPlainSuggestion = false;
655+
var nextIsPlainSuggestion = false;
656656
var result = [];
657657
return _finally(function () {
658658
return _catch(function () {
@@ -671,7 +671,7 @@ var VueSimpleSuggest = {
671671
result = [result];
672672
}
673673

674-
_this12.isPlainSuggestion = _typeof(result[0]) !== 'object' && typeof result[0] !== 'undefined' || Array.isArray(result[0]);
674+
nextIsPlainSuggestion = _typeof(result[0]) !== 'object' && typeof result[0] !== 'undefined' || Array.isArray(result[0]);
675675

676676
if (_this12.filterByQuery) {
677677
result = result.filter(function (el) {
@@ -695,6 +695,7 @@ var VueSimpleSuggest = {
695695
result.splice(_this12.maxSuggestions);
696696
}
697697

698+
_this12.isPlainSuggestion = nextIsPlainSuggestion;
698699
return result;
699700
});
700701
} catch (e) {

dist/es6.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ var VueSimpleSuggest = {
616616
_this4.$emit('request-start', value);
617617
}
618618

619-
_this4.isPlainSuggestion = false;
619+
let nextIsPlainSuggestion = false;
620620
let result = [];
621621
return _finally(function () {
622622
return _catch(function () {
@@ -635,7 +635,7 @@ var VueSimpleSuggest = {
635635
result = [result];
636636
}
637637

638-
_this4.isPlainSuggestion = typeof result[0] !== 'object' && typeof result[0] !== 'undefined' || Array.isArray(result[0]);
638+
nextIsPlainSuggestion = typeof result[0] !== 'object' && typeof result[0] !== 'undefined' || Array.isArray(result[0]);
639639

640640
if (_this4.filterByQuery) {
641641
result = result.filter(el => _this4.filter(el, value));
@@ -657,6 +657,7 @@ var VueSimpleSuggest = {
657657
result.splice(_this4.maxSuggestions);
658658
}
659659

660+
_this4.isPlainSuggestion = nextIsPlainSuggestion;
660661
return result;
661662
});
662663
}),

dist/es7.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ var VueSimpleSuggest = {
553553
this.$emit('request-start', value);
554554
}
555555

556-
this.isPlainSuggestion = false;
556+
let nextIsPlainSuggestion = false;
557557
let result = [];
558558
try {
559559
if (this.listIsRequest) {
@@ -567,7 +567,7 @@ var VueSimpleSuggest = {
567567
result = [result];
568568
}
569569

570-
this.isPlainSuggestion = typeof result[0] !== 'object' && typeof result[0] !== 'undefined' || Array.isArray(result[0]);
570+
nextIsPlainSuggestion = typeof result[0] !== 'object' && typeof result[0] !== 'undefined' || Array.isArray(result[0]);
571571

572572
if (this.filterByQuery) {
573573
result = result.filter(el => this.filter(el, value));
@@ -587,6 +587,7 @@ var VueSimpleSuggest = {
587587
result.splice(this.maxSuggestions);
588588
}
589589

590+
this.isPlainSuggestion = nextIsPlainSuggestion;
590591
return result;
591592
}
592593
},

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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ export default {
581581
this.$emit('request-start', value)
582582
}
583583
584-
this.isPlainSuggestion = false
584+
let nextIsPlainSuggestion = false
585585
let result = []
586586
try {
587587
if (this.listIsRequest) {
@@ -593,7 +593,7 @@ export default {
593593
// IFF the result is not an array (just in case!) - make it an array
594594
if (!Array.isArray(result)) { result = [result] }
595595
596-
this.isPlainSuggestion = (typeof result[0] !== 'object' && typeof result[0] !== 'undefined') || Array.isArray(result[0])
596+
nextIsPlainSuggestion = (typeof result[0] !== 'object' && typeof result[0] !== 'undefined') || Array.isArray(result[0])
597597
598598
if (this.filterByQuery) {
599599
result = result.filter((el) => this.filter(el, value))
@@ -617,6 +617,7 @@ export default {
617617
result.splice(this.maxSuggestions)
618618
}
619619
620+
this.isPlainSuggestion = nextIsPlainSuggestion
620621
return result
621622
}
622623
},

0 commit comments

Comments
 (0)