fix(chat): keep input visible when conversation overflows viewport

The chat layout is a flex column (.chat) inside .platform-route-outlet,
with .chat_scroll_box {flex:1; overflow-y:auto} above .input-container.
Flex items default to min-height:auto, so when messages outgrew the
viewport the scroll box was stretched by its content instead of
scrolling internally. That pushed the input container out of view and
broke page-level scrolling because the parent clips overflow.

- .chat: add min-height:0 so its flex:1 child can shrink
- .chat_scroll_box: add min-height:0 to enable overflow-y scrolling
- .input-container: add flex-shrink:0 so a tall scroll box cannot
  squeeze it to zero height
This commit is contained in:
wizardchen
2026-04-29 17:25:45 +08:00
committed by lyingbug
parent da90867dd4
commit 1fe1f853d5
+14
View File
@@ -1234,6 +1234,11 @@ onBeforeRouteUpdate((to, from, next) => {
padding: 20px;
box-sizing: border-box;
flex: 1;
// The parent .platform-route-outlet is a flex column with min-height:0
// and overflow:hidden — we also need min-height:0 here so that our
// own flex:1 child (.chat_scroll_box) can shrink below its content
// height and scroll instead of pushing .input-container out of view.
min-height: 0;
position: relative;
display: flex;
flex-direction: column;
@@ -1272,6 +1277,12 @@ onBeforeRouteUpdate((to, from, next) => {
.chat_scroll_box {
flex: 1;
// Without min-height: 0, a flex-column child defaults to min-height: auto
// and expands to fit all inner content. When there are many messages,
// that pushes .input-container out of the viewport. Clamping min-height
// to 0 lets overflow-y: auto take effect so the messages scroll inside
// this box instead of stretching it.
min-height: 0;
width: 100%;
overflow-y: auto;
@@ -1372,6 +1383,9 @@ onBeforeRouteUpdate((to, from, next) => {
.input-container {
min-height: 115px;
// Keep the input visible when messages overflow: without flex-shrink: 0
// a tall .chat_scroll_box can squeeze this container down to 0 height.
flex-shrink: 0;
margin: 16px auto 4px;
width: 100%;
max-width: 800px;