Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7234,20 +7234,24 @@ export abstract class IgxGridBaseDirective implements GridType,
if (!this._height) {
return null;
}
const styles = this.document.defaultView.getComputedStyle(this.nativeElement);
const actualTheadRow = this.getTheadRowHeight();
const footerHeight = this.getFooterHeight();
const toolbarHeight = this.getToolbarHeight();
const pagingHeight = this.getPagingFooterHeight();
const groupAreaHeight = this.getGroupAreaHeight();
const scrHeight = this.getComputedHeight(this.scr.nativeElement);
const borderTop = parseFloat(styles.getPropertyValue('border-top-width')) || 0;
const borderBottom = parseFloat(styles.getPropertyValue('border-bottom-width')) || 0;

const renderedHeight = toolbarHeight + actualTheadRow +
footerHeight + pagingHeight + groupAreaHeight +
scrHeight;
scrHeight + borderTop + borderBottom;
Comment on lines +7237 to +7249
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bug fix changes how body height is computed when borders are applied, but there is no unit/integration test covering the reported scenario (grid with percent height/width inside a container + CSS border leading to runaway growth). Please add a spec that renders an IgxGrid with 100% height and a non-zero border and asserts that the calculated body height stabilizes (no repeated size increases across change detection / resize observer cycles).

Copilot uses AI. Check for mistakes.

let gridHeight = 0;

if (this.isPercentHeight) {
const computed = this.document.defaultView.getComputedStyle(this.nativeElement).getPropertyValue('height');
const computed = styles.getPropertyValue('height');
const autoSize = this._shouldAutoSize(renderedHeight);
if (autoSize || computed.indexOf('%') !== -1) {
const bodyHeight = this.getDataBasedBodyHeight();
Expand Down
4 changes: 4 additions & 0 deletions src/app/grid-auto-size/grid-auto-size.sample.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
margin-bottom: 16px;
max-width: 900px;
}

igx-grid {
border: 1px solid lightgray;
}
Loading