在iOS版本的搜索 点击搜索词 会及时显示
在安卓机器上不会显示
同样问题 发现 在 亚马逊海淘购 这个小程序的 搜索框 也会出现 有时候显示 有时候不显示问题。
代码参考
<view class="page" >
<view class="page__hd">
<view class="page__title">SearchBar</view>
<view class="page__desc">搜索栏</view>
</view>
<view class="page__bd">
<view class="weui-search-bar {{inputShowed ? 'weui-search-bar_focusing' : ''}}" id="searchBar">
<form class="weui-search-bar__form">
<view class="weui-search-bar__box">
<i class="weui-icon-search"></i>
<input type="text" class="weui-search-bar__input" placeholder="搜索" value="{{inputVal}}" focus="{{inputShowed}}" bindinput="inputTyping" />
<span class="weui-icon-clear" wx:if="{{inputVal.length > 0}}" bindtap="clearInput"></span>
</view>
<label class="weui-search-bar__label" bindtap="showInput">
<i class="weui-icon-search"></i>
<span class="weui-search-bar__text">搜索</span>
</label>
</form>
<view class="weui-search-bar__cancel-btn" bindtap="hideInput">取消</view>
</view>
<view class="weui-cells searchbar-result" wx:if="{{inputVal.length > 0}}">
<view class="weui-cell weui-cell_active weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>{{inputVal}}</view>
</view>
</view>
<view class="weui-cell weui-cell_active weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view data-val="搜索你好" bindtap="search">搜索你好</view>
</view>
</view>
</view>
</view>
</view>
Page({
data: {
inputShowed: false,
inputVal: ""
},
showInput: function () {
this.setData({
inputShowed: true
});
},
hideInput: function () {
this.setData({
inputVal: "",
inputShowed: false
});
},
clearInput: function () {
this.setData({
inputVal: ""
});
},
inputTyping: function (e) {
this.setData({
inputVal: e.detail.value
});
},
search:function(e){
let val=e.currentTarget.dataset.val
this.setData({
inputVal:val
});
}
});
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)