input在失去焦点之后,莫名原因再次获得焦点,导致输入法会再次弹出 的BUG
代码:
< view wx:for = "{{inputList}}" wx:key = "{{item}}" > < input focus = '{{item.isfocus}}' data-index = '{{index}}' value = '{{item.str}}' bindfocus = 'focus' bindblur = 'blur' ></ input > </ view > |
Page({ data: { inputList: [{ str: '' , isfocus: false }] }, focus: function (e) { let index = e.currentTarget.dataset.index let inputList = this .data.inputList inputList[index].isfocus = true this .setData({ inputList: inputList }) }, blur: function (e) { let index = e.currentTarget.dataset.index let inputList = this .data.inputList inputList[index].isfocus = false this .setData({ inputList: inputList }) } }) |
BUG现象:
真机测试,在获得焦点的情况下,点击受过输入法左上角的收起,会循环触发focus和blur,导致输入法不停的弹出收起,几次后最终收起。
发现问题在于多个input,且使用了focus属性并通过事件去控制属性就会出错
有无解决方法?
这个问题之前提过一次,无答复