Skip to content
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

[DataGrid] Fix selection issue #126

Merged
merged 2 commits into from
Jul 28, 2020
Merged
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
1 change: 1 addition & 0 deletions packages/grid/x-grid-modules/src/components/row-cells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const RowCells: React.FC<RowCellsProps> = React.memo((props) => {
if (column.valueGetter) {
// Value getter override the original value
value = column.valueGetter(cellParams);
cellParams.value = value;
}

let formattedValueProp = {};
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion packages/storybook/integration/staticStories.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ const stories = [
await page.click('#action-btn');
},
},
{
path: '/story/x-grid-tests-selection--multiple-select-with-checkbox-no-click',
beforeTest: async (page) => {
await page.click(
'.grid-root .window .material-row:first-child .material-cell.checkbox-selection-cell .checkbox-input',
);
},
},
'/story/x-grid-tests-columns--header-component',
'/story/x-grid-tests-columns--new-column-types',
'/story/x-grid-tests-dataset--no-rows',
Expand Down Expand Up @@ -82,7 +90,7 @@ const stories = [
'/story/x-grid-tests-styling--column-cell-renderer',
];

describe.only('snapshotTest', () => {
describe('snapshotTest', () => {
stories.forEach((config: any) => {
const path = typeof config === 'string' ? config : config.path;
const beforeTest = typeof config === 'string' ? undefined : config.beforeTest;
Expand Down
8 changes: 8 additions & 0 deletions packages/storybook/src/stories/grid-selection.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ export const MultipleSelect = () => {
return <XGrid rows={data.rows} columns={data.columns} options={options} />;
};
export const MultipleSelectWithCheckbox = () => {
const data = useData(200, 200);
const options: GridOptionsProp = {
checkboxSelection: true,
};

return <XGrid rows={data.rows} columns={data.columns} options={options} />;
};
export const MultipleSelectWithCheckboxNoClick = () => {
const data = useData(200, 200);
const options: GridOptionsProp = {
checkboxSelection: true,
Expand Down