1.textarea的內(nèi)容隨著屏幕上下移動(dòng)
解決:
textarea組件在一個(gè) position:fixed 的區(qū)域,需要顯示指定屬性 fixed 為 true
<textarea fixed="true"></textarea>
2.android機(jī)下,自定義模態(tài)框含有auto-height的textarea組件,彈起鍵盤,模態(tài)框被遮擋無法上彈
解決:
(1).獲取鍵盤彈起高度
(2).設(shè)置模態(tài)框padding-bottom為鍵盤彈起高度
//wxml
<view style="padding-bottom:{{keyboradHeight}}px;">
<textarea bindfocus="bindFocus"></textarea>
</view>
//js
bindFocus(e){
let _this = this;
let keyboradHeight = e.detail.height;
_this.setData({
keyboradHeight
})
}
3.ios下,自定義模態(tài)框含有auto-height的textarea組件,在textarea內(nèi)部滑動(dòng),導(dǎo)致模態(tài)框底部頁(yè)面隨著滑動(dòng)
解決:
即使通過catchtouchmove="true"阻止底部滾動(dòng)事件不被觸發(fā),也無法阻止textarea穿透。目前只能不設(shè)置auto-height屬性。
<textarea></textarea>