(修正)Table组件高度溢出Issues #7901#7920
Open
Tony-ST0754 wants to merge 3 commits intomainfrom
Open
Conversation
|
Thanks for your PR, @Tony-ST0754. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the Table component container and sub-sections to use a flex column layout with controlled flex-shrink behavior and box-sizing so that the fixed-header table body resizes correctly without height jitter when search and toolbar areas change height. Flow diagram for Table container flex layout structureflowchart TD
table_container[".table-container (display:flex, flex-direction:column, box-sizing:border-box, height:100%)"]
table_search[".table-search (flex-shrink:0, box-sizing:border-box)"]
table_toolbar[".table-toolbar (flex-shrink:0, box-sizing:border-box)"]
table_fixed[".table-fixed/.table-shim (flex-shrink:1, box-sizing:border-box, height:100%, overflow:hidden)"]
nav_pages[".nav-pages (flex-shrink:0, box-sizing:border-box, margin-block-start:.5rem)"]
table_container --> table_search
table_container --> table_toolbar
table_container --> table_fixed
table_container --> nav_pages
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- For the main table body (
.table-fixed), relying onheight: 100%inside a flex container can be fragile; consider usingflex: 1 1 auto(and possibly droppingheight: 100%) so it naturally takes the remaining space and behaves more predictably in nested layouts. - You’re adding
box-sizing: border-boxto multiple elements that likely already inherit it from a global rule; if that’s the case in this project, you can simplify by only setting it where behavior truly differs to avoid redundant declarations.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- For the main table body (`.table-fixed`), relying on `height: 100%` inside a flex container can be fragile; consider using `flex: 1 1 auto` (and possibly dropping `height: 100%`) so it naturally takes the remaining space and behaves more predictably in nested layouts.
- You’re adding `box-sizing: border-box` to multiple elements that likely already inherit it from a global rule; if that’s the case in this project, you can simplify by only setting it where behavior truly differs to avoid redundant declarations.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(修正)Table组件高度溢出Issues #7901
Link issues
fixes #7901
问题描述 / Problem Description
当
Table组件启用IsFixedHeader属性值为true,且Height指定了固定值时,由于组件可能在使用过程中将搜索面板置于Table组件顶部,且搜索面板的高度值是会随着开发人员给定的搜索条件的数量来变化,因此,导致需要重算Table组件的主体部分的高度,因此,在页面渲染时出现的高度“抖动”或“由高变低”的现象。解决方案 / Solution
经仔细观察
Table组件渲染生成时.table-container下主要分为四大块:1、
.table-search当组件将SearchMode属性设为SearchMode.Top时生成2、
.table-toolbar当组件将ShowToolbar属性设为true时生成3、
.table-shim组件的主体部分,当IsFixedHeader为true时,则有.table-fixed4、
.nav-pages组件的分页控制部分采用flex响应式布局处理,方案如下:
思考:Table.razor.js中计算高度的过程是否还有必要保留?!
疑虑:目前我不确定是否还存在其他方面的功能需要用到这个计算
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge