Skip to content

Commit

Permalink
[EuiDataGrid] Fix wrong columns assigned to leadColumns (#4269)
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal authored Nov 20, 2020
1 parent 4248003 commit 7cdafea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
- Unify colors with the Elastic brand ([#4284](https://github.com/elastic/eui/pull/4284))
- Created one consistent look for disabled `EuiButton` ([#4284](https://github.com/elastic/eui/pull/4284))

*Bug fixes**

- Fixed wrong columns assigned to `EuiDataGrid` leadingControlColumns ([#4269](https://github.com/elastic/eui/pull/4269))

## [`30.4.0`](https://github.com/elastic/eui/tree/v30.4.0)

- Added `eql` glyph in `EuiIcon` ([#4110](https://github.com/elastic/eui/pull/4110))
Expand Down
10 changes: 5 additions & 5 deletions src/components/datagrid/data_grid_data_row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const EuiDataGridDataRow: FunctionComponent<EuiDataGridDataRowProps> = memo(
visibleRowIndex={visibleRowIndex}
colIndex={i}
columnId={id}
column={columns[i]}
column={leadingColumn}
popoverContent={DefaultColumnFormatter}
width={leadingColumn.width}
renderCellValue={rowCellRender}
Expand Down Expand Up @@ -136,8 +136,8 @@ const EuiDataGridDataRow: FunctionComponent<EuiDataGridDataRowProps> = memo(
/>
);
})}
{trailingControlColumns.map((leadingColumn, i) => {
const { id, rowCellRender } = leadingColumn;
{trailingControlColumns.map((trailingColumn, i) => {
const { id, rowCellRender } = trailingColumn;
const colIndex = i + columns.length + leadingControlColumns.length;

return (
Expand All @@ -147,9 +147,9 @@ const EuiDataGridDataRow: FunctionComponent<EuiDataGridDataRowProps> = memo(
visibleRowIndex={visibleRowIndex}
colIndex={colIndex}
columnId={id}
column={columns[colIndex]}
column={trailingColumn}
popoverContent={DefaultColumnFormatter}
width={leadingColumn.width}
width={trailingColumn.width}
renderCellValue={rowCellRender}
onCellFocus={onCellFocus}
isFocused={focusedCellPositionInTheRow === colIndex}
Expand Down

0 comments on commit 7cdafea

Please sign in to comment.