表格中存在固定列时(左/右),让组件中DefaultFixedColumnWidth属性值正确生效#8073
Open
Tony-ST0754 wants to merge 2 commits into
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 GuideEnsures the table's DefaultFixedColumnWidth is applied to fixed columns without explicit widths and updates the corresponding unit test to verify the col element width styling. Flow diagram for applying DefaultFixedColumnWidth to fixed columnsflowchart TD
A[CreateTableColumnState] --> B[Check col.Fixed]
B -->|false| C[Width = col.Width]
B -->|true| D[Check col.Width.HasValue]
D -->|true| C
D -->|false| E[Width = DefaultFixedColumnWidth]
C --> F[Return TableColumnState]
E --> F
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:
- The added
using System.Drawing;namespace inTable.razor.csdoesn’t appear to be used and can be removed to keep dependencies minimal. - In the updated unit test,
var col = cut.FindAll("col");is unused and the boolean assertion could be simplified toAssert.True(fixedWidth);to make the test clearer and more idiomatic.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The added `using System.Drawing;` namespace in `Table.razor.cs` doesn’t appear to be used and can be removed to keep dependencies minimal.
- In the updated unit test, `var col = cut.FindAll("col");` is unused and the boolean assertion could be simplified to `Assert.True(fixedWidth);` to make the test clearer and more idiomatic.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8073 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 766 766
Lines 34171 34171
Branches 4700 4701 +1
=========================================
Hits 34171 34171
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fix:让参数,DefaultFixedColumnWidth,生效 refactor: 修改单元测试 desc:当列固定时,默认固定列宽度没给到表格上,导致用户在改变表格列宽时,导致表格会整体重算列宽时,将固定列宽错误重计算,但固定列上style中left或right的值还是默认的200px,从而在横向滑动时出现错位
a8933c8 to
e3b6907
Compare
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.
fix:让参数,DefaultFixedColumnWidth,生效
refactor: 修改单元测试
desc:当列固定时,默认固定列宽度没给到表格上,导致用户在改变表格列宽时,表格会整体重算全部列宽(包括固定列列宽)时,将固定列宽错误重计算,但固定列上style中left或right的值还是默认的200px,从而在横向滑动时出现错位
Link issues
fixes #8072
问题描述 / Problem Description
当列固定时,默认固定列宽度没给到表格上,导致用户在改变表格列宽时,导致表格会整体重算列宽时,将固定列宽错误重计算,但固定列上style中left或right的值还是默认的200px,从而在横向滑动时出现错位
复现代码示例
BootstrapBlazorApp11.zip
解决方案 / Solution
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Ensure fixed table columns correctly apply the default fixed column width when no explicit width is provided.
Bug Fixes:
Tests: