部分手机input的type=number时,键盘无法弹出
- 当前 Bug 的表现(可附上截图)
- 预期表现
应该进去默认弹出键盘,或者点击之后弹出
-
复现路径
-
提供一个最简复现 Demo
<view class=“password-box”>
<view class=‘password-wrapper’>
<!-- 伪装的input –>
<block wx:for=“{{inputLength}}” wx:key=“item”>
<!-- 宽高可以由外部指定 –>
<view class=“password-item {{currentValue.length === index ? ‘password-active’ : ‘’}}” style=“width: {{inputWidth}}; height: {{inputHeight}}” catchtap=‘_focusInput’>
<!-- 隐藏密码时显示的小圆点【自定义】 –>
<view wx:if=“{{!showValue && currentValue.length>=index+1}}” class=“hidden”></view>
<!-- 显示密码时显示对应的值 –>
<view wx:if=“{{showValue}}” class=“show”>
{{currentValue.length>=index+1?currentValue[index]:‘’}}
</view>
</view>
</block>
</view>
<!-- 隐藏的输入框 –>
<input type=“number” password=“{{true}}” value=“{{currentValue}}” class=‘hidden-input’ maxlength=“{{inputLength}}” focus=“{{inputFocus}}” bindinput=“_setCurrentValue”></input>
</view>
_focusInput() {
this.setData({
inputFocus: true
});
},
