From c1ff6587ad7a942cd0863ddacb171fd56de91a6a Mon Sep 17 00:00:00 2001 From: Malik <15927396+cappic90@users.noreply.github.com> Date: Tue, 13 Sep 2022 06:18:05 +0200 Subject: [PATCH] #2512: Update search suggestions on input (#2567) * #2512: Update visible data list on input * #2512: Remove excessive visible data list update on input --- src/renderer/components/ft-input/ft-input.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/ft-input/ft-input.js b/src/renderer/components/ft-input/ft-input.js index c5ee9451..ca58efff 100644 --- a/src/renderer/components/ft-input/ft-input.js +++ b/src/renderer/components/ft-input/ft-input.js @@ -87,6 +87,13 @@ export default Vue.extend({ return this.inputData.length > 0 } }, + watch: { + dataList(val, oldVal) { + if (val !== oldVal) { + this.updateVisibleDataList() + } + } + }, mounted: function () { this.id = this._uid this.inputData = this.value @@ -109,7 +116,6 @@ export default Vue.extend({ this.searchState.selectedOption !== -1 && this.inputData === this.visibleDataList[this.searchState.selectedOption]) { return } this.handleActionIconChange() - this.updateVisibleDataList() this.$emit('input', val) },