Repository navigation
Conversation
wenzhixin
left a comment
There was a problem hiding this comment.
Pull request overview
This PR fixes #7830: on host pages without a global box-sizing: border-box rule, combining height with the table-bordered class made .fixed-table-border render 2px wider than the scroll container, producing an unexpected horizontal scrollbar. resetView() writes the table outerWidth into the div (src/modules/body.js:507) while the div carries border-left/right: 1px (src/themes/_theme.scss:201-202), so content-box pages add those borders on top of the width. Adding box-sizing: border-box + max-width: 100% makes the component independent of host CSS.
Changes:
src/themes/_theme.scss:.fixed-table-borderunder.fixed-heightgainsbox-sizing: border-boxandmax-width: 100%, with an explanatory comment.
Reviewed changes
Reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/themes/_theme.scss | border-box + width clamp on .fixed-table-border |
Verification
- Static cross-checks (no CI run locally):
- Root cause confirmed: the div is only created for
height+table-bordered(src/modules/initialization.js:155-158) and receiveswidth: $bodyTable.outerWidth()inline (src/modules/body.js:507), so content-box pages render it 2px wider than the table. - The rule compiles to
.bootstrap-table .fixed-table-container.fixed-height .fixed-table-border, matchingaddClass('fixed-height')on the container (initialization.js:149);_theme.scssis shared by all 5 themes via@use "../theme"and no_custom.scssoverrides these properties. - Bonus effect verified as positive: initialization.js:158 also adds
fixed-table-borderto$tableLoading, so the loading overlay picks up the same declarations. The overlay already declareswidth/max-width: 100%(theme.scss:238-239) and gets an inline tableouterWidth(header.js:295), soborder-boxfixes the same 2px overflow for the loading overlay on content-box pages, with no conflict. - No regression for the usual frameworks: Bootstrap/Bulma/Foundation/Materialize/Semantic all ship a global
border-boxrule, so both declarations are no-ops there; the clamp is also direction-agnostic for RTL.
- Root cause confirmed: the div is only created for
- CI on the PR head is green (lint incl. stylelint, vitest, cypress).
Recommendation: good to merge — the inline comment below is a confirm-intent note about an edge case, not a blocker.
…red and height set
wenzhixin
left a comment
There was a problem hiding this comment.
Pull request overview
Follow-up review after the push to 96e9bbb7. This PR fixes #7830: on host pages without a global box-sizing: border-box rule, height combined with table-bordered makes .fixed-table-border 2px wider than the scroll container, showing an unexpected horizontal scrollbar.
This second pass covers only the incremental change from the previously reviewed head 4682dde8, which is a single commit touching one file.
Changes since 4682dde8:
src/themes/_theme.scss: the comment abovebox-sizing: border-box/max-width: 100%was expanded to state the role of each declaration and to record the wide-table trade-off explicitly - when the table is wider than the body and scrolls horizontally, the clamp stops the div at the visible body width, so its right border no longer tracks the table's right edge. No CSS declaration changed; only comment lines were added (+6/-2).
Reviewed changes
Reviewed 1 out of 1 incrementally changed files (the full PR spans 1 file) and generated no new comments.
| File | Description |
|---|---|
src/themes/_theme.scss |
Comment-only update documenting the border-box / max-width responsibilities and the intentional clamp behavior for wide tables |
Verification
git diff 4682dde8..96e9bbb7shows only comment lines under the.fixed-table-borderrule;box-sizing: border-boxandmax-width: 100%are byte-identical to the previously reviewed head.- The comment matches the code:
src/modules/body.js:507setswidthto$bodyTable.outerWidth(), andmax-width: 100%resolves against the.fixed-table-containercontaining block, which is what produces the documented clamp. - The added lines are Sass silent comments (
//), so they are stripped at compile time and the generated CSS is unchanged. - No JS or
src/constants/index.jschange, so the type generation drift check is not applicable. - CI
Test/changesandTest/testare green on96e9bbb7.
Remaining notes (non-blocking)
None - the single informational finding from the first pass (documenting the wide-table clamp trade-off) is now addressed.
Recommendation: good to merge.
🤔Type of Request
🔗Resolves an issue?
Fix #7830
📝Changelog
heightis set together with thetable-borderedclass on pages without a globalbox-sizing: border-boxrule💡Example(s)?
.fixed-table-borderis 498px wide inside a 495px body, a horizontal scrollbar appearsBoth examples add
* { box-sizing: content-box }to simulate a host page without a global border-box rule (the live editor loads Bootstrap 5, whose universalborder-boxrule hides the defect), and force a 15px scrollbar so the difference is visible on overlay-scrollbar platforms. The After link is pinned to commit 4682dde because jsDelivr caches the%2Fbranch variant separately.Root cause
src/modules/body.js:507writes the tableouterWidthto the.fixed-table-borderdiv created insrc/modules/initialization.js:156. That div hasborder-left/right: 1px, and without an explicitbox-sizingits own borders are added on top of the width in content-box pages, making it 2px wider than the scroll container. Bootstrap pages are unaffected because their globalbox-sizing: border-boxrule covers it. Addingbox-sizing: border-boxplusmax-width: 100%makes the component independent of the host CSS.Verification
yarn lint:csspassedscrollWidth1176 -> 1174, horizontal overflow gone; no regression with a vertical scrollbar or the loading state☑️Self Check before Merge