feat:修复键盘的问题

This commit is contained in:
2025-08-05 20:01:30 +08:00
parent 9ca2d72256
commit e539c7d35d
4 changed files with 133 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
.chat-container {
.chat-container {
width: 100vw;
height: 100vh;
background-color: #E9F3F7;
@@ -6,7 +6,9 @@
display: flex;
flex-direction: column;
overflow: hidden !important;
position: relative;
position: relative;
/* 确保在键盘弹起时布局正确 */
box-sizing: border-box;
.chat-container-bg {
position: fixed;
@@ -20,14 +22,12 @@
.chat-content {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
z-index: 1;
overflow: hidden;
overflow: hidden;
}
.chat-container-top-bannar {
@@ -77,13 +77,19 @@
.footer-area {
width: 100vw;
flex-shrink: 0;
padding: 4px 0 24px 0;
padding: 4px 0 20px 0; /* 直接设置20px底部安全距离 */
background-color: #E9F3F7;
touch-action: pan-x; /* 仅允许横向触摸滚动 */
overflow-x: auto; /* 允许横向滚动 */
overflow-y: hidden; /* 禁止垂直滚动 */
/* 确保高度能够正确计算 */
touch-action: pan-x;
overflow-x: auto;
overflow-y: hidden;
min-height: fit-content;
/* 安卓键盘适配 - 使用相对定位配合adjustPan */
position: relative;
z-index: 1000;
transition: padding-bottom 0.3s ease;
/* 确保输入区域始终可见 */
transform: translateZ(0);
-webkit-transform: translateZ(0);
}
.area-input {