Skip to content

Commit cc6eb46

Browse files
committed
fix(Chatbox): 设定消息列表内容的最小高度,修复由于反向 flex 布局导致消息内容较少时从底部开始加载的问题, Close #362
1 parent 9671efb commit cc6eb46

File tree

1 file changed

+3
-2
lines changed
  • packages/react-app/src/components/chatbox

1 file changed

+3
-2
lines changed

packages/react-app/src/components/chatbox/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,11 @@ export const Chatbox = (props: ChatboxProps) => {
307307
style={{
308308
display: 'flex',
309309
flexDirection: 'column-reverse',
310-
paddingTop: '12px',
310+
// 减去除消息列表外其他纵向元素的高度
311+
minHeight: 'calc(100vh - 10.25rem)',
311312
}}
312313
>
313-
<div className="flex-1 w-full md:!w-3/4 mx-auto px-3 md:px-0 box-border">
314+
<div className="flex-1 w-full md:!w-3/4 mx-auto px-3 pb-6 md:px-0 box-border">
314315
{/* 🌟 消息列表 */}
315316
<Bubble.List
316317
items={items}

0 commit comments

Comments
 (0)