icindy / wxSearch

wxSearch-微信小程序优雅的搜索框

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug:wxSearchBlur与其他事件设置数据时的冲突

eightHundreds opened this issue · comments

现象:
在模拟器上正常,在真机上发现点击搜索历史项时搜索栏内容并不改变,或者改变后瞬间变回去。

初步猜想:
当wxSearchKeyTap触发后几乎瞬间,wxSearchBlur触发。后者有设置Data的操作,可能这里的Data是旧的。

使用手机:用了1年的小米4

commented

好的 谢谢反馈

commented

后来解决了吗?

引用的时候将:

wxSearchBlur: function(e){
    WxSearch.wxSearchBlur(e,this);
  },

改成:

wxSearchBlur: function(e){
    WxSearch.wxSearchAddHisKey(this);// 添加历史搜索记录
    this.GetKeyList(this.data.wxSearchData.value);// 后端交互
  },

呵呵,如上处理以后,模拟器不行了。

commented

不要设置wxSearchBlur处理函数

GetKeyList 这个函数没发现,另外修改后无法运行

引用的时候将:

wxSearchBlur: function(e){
    WxSearch.wxSearchBlur(e,this);
  },

改成:

wxSearchBlur: function(e){
    WxSearch.wxSearchAddHisKey(this);// 添加历史搜索记录
    this.GetKeyList(this.data.wxSearchData.value);// 后端交互
  },

GetKeyList 这个函数没发现,另外修改后无法运行