浏览代码

fixed searchform bug

bach 3 年之前
父节点
当前提交
602753c775
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      web/themes/custom/materiotheme/vuejs/components/Form/SearchForm.vue

+ 2 - 1
web/themes/custom/materiotheme/vuejs/components/Form/SearchForm.vue

@@ -37,10 +37,11 @@ export default {
       event.preventDefault();
       console.log('autoCompleteSelect', event, ui);
       this.typed = ui.item.label
+      // we have to wait for typed watch to reset autocomplete before setting it
       setTimeout(function(){
         console.log('update autocomplete value after settimeout');
         this.autocomplete = ui.item.value
-        if(this.typed !== this.keys && this.autocomplete !== this.term){
+        if(this.typed !== this.keys || this.autocomplete !== this.term){
           this.submit()
         }
       }.bind(this), 1)