2494关注7512浏览
当弹层为fixed属性时,textarea 中添加placeholder 标签属性,拖动背景层移动,这时placeholder中的文字会跟随背景移动
- 预期表现
- 复现路径
- 提供一个最简复现
wxml
<view class='pinlunpop' wx:if="{{helpshow}}">
<view class='con'>
<view class='tit'>{{helinfotit}}</view>
<textarea class='txtr' bindinput="bindTextAreaBlur" placeholder='最多输入200字' maxlength='200' placeholder-class='txtrpl' focus='{{helpshow}}'></textarea>
<view class='btns flex'>
<view class='btn flex_tel' bindtap='closepinl'>取消</view>
<view class='btn flex_tel btnn' bindtap='pinlun'>确定</view>
</view>
</view>
</view>
wxss
.pinlunpop{width: 100%;height: 100%;position: fixed;left: 0;top:0;background-color: rgba(0, 0, 0, 0.5);z-index:9;}
.pinlunpop .con{width: 600rpx;height: 430rpx;margin: 0 auto;margin-top: 40%;background-color: #ffffff;border-radius: 20rpx;padding: 25rpx;}
.pinlunpop .con .tit{width: 100%;height: 40rpx;line-height: 40rpx;padding-left: 25rpx;font-size: 30rpx;color: #333333;margin-bottom: 20rpx;}
.pinlunpop .con .txtrbox{width: 100%;height: 240rpx;border: 1px solid #efefef;border-radius: 8rpx;position: relative;}
.pinlunpop .con .txtr{width: 100%;height: 240rpx;border: 0;resize: none;padding: 20rpx;font-size: 30rpx;color: #333333;}
.pinlunpop .con .txtbnum{position: absolute;left: 0;top: 0;font-size: 30rpx;color: #999999;}
.pinlunpop .con .txtrpl{font-size: 28rpx;}
.pinlunpop .con .btns{width: 100%;height: 80rpx;margin-top: 10rpx;}
.pinlunpop .con .btns .btn{height: 70rpx;border-radius: 8rpx;text-align: center;line-height: 70rpx;font-size: 30rpx;color: #999999;border: 1px solid #f7f7f7;margin: 0 6rpx;}
.pinlunpop .con .btns .btnn{color: #41d170;border: 1px solid #41d170;}
-
至过去的我
2044人对此回答表示赞同
我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多> -
夏雨
7人对此回答表示赞同
你给出来的这段代码并不能拖动背景,没办法复现你说的情况……能不能麻烦给个相关的代码片段?
展开75回复分享发布于 6年前评论(5)
收起评论
确实是要在textarea中设置fixed属性,这个问题是我没有仔细看文档,对此造成的不便,请谅解一下
嗯,是fixed属性,不是css的position:fixed,你可以确认一下文档
它的父级容器是fixed,textarea也要加上fixed属性是吗,测试妹纸下班了,测试机带走了,明天我试一下
参考一下文档的fixed属性https://developers.weixin.qq.com/miniprogram/dev/component/textarea.html:
分享访问链接:wechatide://minicode/h6IRWum37e1G