关于小程序input框点击抖动和在真机模式键盘偶尔不调起键盘

744 阅读1分钟

今天写的是第一篇文章,本人比较菜,还在前端的路上摸爬滚打,哈哈哈哈

前两天写了一个小程序,里面有用到input框,发现input框在真机上,点击的时候会抖动,代码如下:

<view class="row-wrap">
        <view class="label">店名</view>
        <view class="label-right">
          <input placeholder-class="placeholderStyle" bindinput="businessNameInput" class="input" type="text" placeholder="请输入门店名称" />
        </view>
      </view>

后来百度一波后说input框换成textarea就不会了 ,代码如下:

<view class="row-wrap">
        <view class="label">店名</view>
        <view class="label-right">
          <textarea placeholder-class="placeholderStyle" bindinput="businessNameInput" class="input" type="text" placeholder="请输入门店名称" />
        </view>
      </view>

然后预览之后发现textare的placeholder的样式跑偏了,目前可能支持的有color,font-size,font-weight,然后就想办法调样式,设置textarea外面的盒子大小,去限制他

.row-wrap .asdf{
  padding: 28rpx 0;
  box-sizing: border-box;
}
.row-wrap .label-right textarea {
  width: 100%;
  line-height: 28rpx;
  height: 100%;
  font-size: 28rpx;
  padding-right: 30rpx;
} 

到这里,目前安卓机是没问题的,在苹果机上iPhone X会有问题,placeholder只显示一半,我也头痛,这个问题等我改完了在修改