小程序键盘弹出页面不上推笔记

属性类型默认值必填说明
adjust-positionbooleantrue键盘弹起时,是否自动上推页面
cursor-spacingnumber0指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离
bindfocuseventhandle输入框聚焦时触发,event.detail = { value, height },height 为键盘高度,在基础库 1.9.90 起支持
<view class="footer-input flex flex-btw" style="bottom:{{bottomHeight}}px;">
	<view class="input-box box-s">
		<input class="reply-content" adjust-position="{{false}}" placeholder="期待您的精彩评论" bindfocus="toggleFocus" bindblur="toggleFocus" cursor-spacing="20rpx" type="text" value="{{replyContent}}" />
	</view>
	<view class="re-btn color-fff fts-14 ftw-b">发布</view>
</view>
data:{
	bottomHeight:0,//input距离底部的距离
},
toggleFocus(e){
	this.setData({
		bottomHeight:e&&e.detail.height?e.detail.height:0
	})
},
.footer-input{
	padding: 0 40rpx 0 30rpx;
	height: 112rpx;
	background: #FFFFFF;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
}
.footer-input .input-box{
	width: 500rpx;
	height: 72rpx;
	background: #F5F5F5;
	border: 1px solid #DBDBDB;
	border-radius: 36rpx;
	padding:0 20rpx;
}
.footer-input .input-box .reply-content{
	width: 100%;
	height: 100%;
}
.footer-input .re-btn{
	width: 156rpx;
	height: 72rpx;
	border-radius: 36rpx;
	text-align: center;
	line-height: 72rpx;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值