问题:
1.手机唤起键盘后,看不到文本框
2.弹窗fixed后,textarea内容随页面滚动
解决办法:
1.给textarea 标签设置 cursor-spacing="200" 属性,表示textarea 光标距离键盘的距离。添加fixed属性
<view class="sw-msg" bindtap="transPos">
<textarea fixed bindinput="msgCon" cursor-spacing="200" placeholder="{{placehoderTxt}}" />
</view>
2.点击文本框后设置弹窗position为absolute,关闭文本框后设置弹窗position为fixed
toggle:function () {
this.setData({
pos:'fixed'
})
this.setData({
open:!this.data.open
})
},
transPos(){
this.setData({
pos:'absolute'
})
},