Skip to content

fix(grid): Add flex:1 to the display container so that it grows or shrinks to the available width of the grid #16036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: 20.0.x
Choose a base branch
from
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 @@ -1274,6 +1274,7 @@
%grid-display-container-tr {
width: 100%;
overflow: visible;
flex: 1;
}

%grid-mrl-block {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,18 @@ describe('Basic IgxHierarchicalGrid #hGrid', () => {
);
jasmine.getEnv().allowRespy(false);
});

it('should calculate correct column headers width when rowSelection + expand indicators', () => {
hierarchicalGrid.rowSelection = 'multiple';
fixture.detectChanges();

const headerRowElement = hierarchicalGrid.nativeElement.querySelector("igx-grid-header-row");
const headerRowDiv = headerRowElement.querySelector(".igx-grid__tr");
const headerRowChildren = Array.from(headerRowDiv.children);

const elementsWidth = headerRowChildren.reduce((acc,el) => acc+(el as HTMLElement).offsetWidth, 0);
expect(elementsWidth).toEqual((headerRowDiv as HTMLElement).offsetWidth);
});
});

describe('IgxHierarchicalGrid Row Islands #hGrid', () => {
Expand Down Expand Up @@ -1690,7 +1702,7 @@ describe('Basic IgxHierarchicalGrid #hGrid', () => {
UIInteractions.simulateClickAndSelectEvent(row.expander);
fixture.detectChanges();

let childGrid = hierarchicalGrid.gridAPI.getChildGrids()[0];
const childGrid = hierarchicalGrid.gridAPI.getChildGrids()[0];
const childRow = childGrid.gridAPI.get_row_by_index(0) as IgxHierarchicalRowComponent;
UIInteractions.simulateClickAndSelectEvent(childRow.expander);
fixture.detectChanges();
Expand Down
Loading