fix(fe): 评论页键盘避让改用 bindkeyboardheightchange 移动固定输入条
列表完全不动(adjust-position=false + 页面 overflow:hidden),只有底部 fixed 输入条按键盘高度抬 bottom,聚焦期间不碰输入框其它属性,避免原生 textarea 抖失焦。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
/* flex 列 + 整页 overflow:hidden:页面本身不滚,列表在内层 scroll-view 里滚。
|
||||
这样聚焦时 adjust-position 只能均匀上移整屏,不会过度上滚露出大空白 */
|
||||
/* flex 列 + 整页 overflow:hidden:页面本身不滚(adjust-position=false 时列表纹丝不动),
|
||||
列表在内层 scroll-view 里滚,底部输入条 fixed 覆在最下面 */
|
||||
page{display:flex;flex-direction:column;height:100vh;overflow:hidden;background:var(--bg)}
|
||||
|
||||
.cm-scroll{flex:1;min-height:0;padding:0 var(--sp-5)}
|
||||
/* 底部留白 = 输入条高度,最后几条评论不被固定输入条盖住 */
|
||||
.cm-scroll{flex:1;min-height:0;padding:0 var(--sp-5) 200rpx}
|
||||
.cm-count-head{
|
||||
padding:var(--sp-3) 0;font-size:var(--fs-md);font-weight:var(--fw-b);
|
||||
color:var(--text);border-bottom:1rpx solid var(--line);
|
||||
@@ -44,10 +45,12 @@ page{display:flex;flex-direction:column;height:100vh;overflow:hidden;background:
|
||||
color:var(--primary-ink);background:var(--primary-soft);padding:2rpx var(--sp-1);border-radius:var(--r-full);
|
||||
}
|
||||
|
||||
/* 底部输入条:flex 列里最后一行,不 fixed。整屏靠 adjust-position 均匀上移避让键盘 */
|
||||
/* 底部输入条:固定在底部,键盘弹起时 inline 的 bottom 会被抬到键盘上方(列表不动) */
|
||||
.cm-bar{
|
||||
flex:none;background:#fff;border-top:1rpx solid var(--line);
|
||||
position:fixed;left:0;right:0;bottom:0;z-index:50;
|
||||
background:#fff;border-top:1rpx solid var(--line);
|
||||
padding:var(--sp-3) var(--sp-5) calc(16rpx + env(safe-area-inset-bottom));
|
||||
transition:bottom .15s ease;
|
||||
}
|
||||
.cm-replying{
|
||||
display:inline-flex;align-items:center;gap:var(--sp-2);margin-bottom:var(--sp-2);
|
||||
|
||||
Reference in New Issue
Block a user