fix(wallet): 修复计费历史弹窗分页与列表重叠 (#5624) - #5627
Conversation
base-ui 的 ScrollArea 仅靠 max-height 无法约束高度:其 Viewport 用 height:100%,当 Root 只有 max-height 而无确定高度时会回退为 auto, 内容撑满并溢出到 Root 之外,盖住下方分页。改用原生 max-h + overflow-y-auto 的 div,列表正确内部滚动,分页作为同级元素干净地排在下方。
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughIn ChangesBilling History Dialog scroll container fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
base-ui 的 ScrollArea 仅靠 max-height 无法约束高度:其 Viewport 用 height:100%,当 Root 只有 max-height 而无确定高度时会回退为 auto, 内容撑满并溢出到 Root 之外,盖住下方分页。改用原生 max-h + overflow-y-auto 的 div,列表正确内部滚动,分页作为同级元素干净地排在下方。
base-ui 的 ScrollArea 仅靠 max-height 无法约束高度:其 Viewport 用 height:100%,当 Root 只有 max-height 而无确定高度时会回退为 auto, 内容撑满并溢出到 Root 之外,盖住下方分页。改用原生 max-h + overflow-y-auto 的 div,列表正确内部滚动,分页作为同级元素干净地排在下方。
base-ui 的 ScrollArea 仅靠 max-height 无法约束高度:其 Viewport 用 height:100%,当 Root 只有 max-height 而无确定高度时会回退为 auto, 内容撑满并溢出到 Root 之外,盖住下方分页。改用原生 max-h + overflow-y-auto 的 div,列表正确内部滚动,分页作为同级元素干净地排在下方。
base-ui 的 ScrollArea 仅靠 max-height 无法约束高度:其 Viewport 用 height:100%,当 Root 只有 max-height 而无确定高度时会回退为 auto, 内容撑满并溢出到 Root 之外,盖住下方分页。改用原生 max-h + overflow-y-auto 的 div,列表正确内部滚动,分页作为同级元素干净地排在下方。
📝 变更描述 / Description
钱包「订单历史 / 计费历史」弹窗在记录较多时,记录列表会溢出并盖住底部分页,导致「显示第 X-Y 条」统计文字与上一页/下一页控件重叠。
根因:列表用的是 base-ui 的
ScrollArea,但只在 Root 上设了max-height。base-ui 的Viewport用height:100%,而当 Root 只有max-height、没有确定height时,按 CSS 规则height:100%会回退为auto,于是 Viewport 撑满全部内容、不产生滚动,并溢出到 Root 之外(Root 不裁剪),盖在下方分页上。修复:将该列表改用原生
max-h + overflow-y-auto的div。原生max-height配合overflow-y-auto能正确约束高度并内部滚动,分页作为同级元素干净地排在列表下方,不再重叠。项目里已有多处采用这种原生滚动写法,且全局* { scrollbar-width: thin }会自动套用细滚动条样式,视觉保持一致。🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
📸 运行证明 / Proof of Work
用还原弹窗真实 class 结构的最小页面验证:列表在
max-height处截断并内部滚动,分页带border-top干净地排在列表下方,无重叠。修复前:

修复后:

Summary by CodeRabbit