1.textarea的內(nèi)容隨著屏幕上下移動
解決:
textarea組件在一個 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ǎo)致模態(tài)框底部頁面隨著滑動
解決:
即使通過catchtouchmove="true"阻止底部滾動事件不被觸發(fā)禀晓,也無法阻止textarea穿透精续。目前只能不設(shè)置auto-height屬性重付。
<textarea></textarea>