Skip to content

Commit

Permalink
Fix reselect column in DatagridEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto committed Oct 18, 2022
1 parent 7210823 commit e961cea
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/ra-ui-materialui/src/list/datagrid/DatagridEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ export const DatagridEditor = (props: {
if (event.target.checked) {
// add the column at the right position
setColumns(
availableColumns.filter(
column =>
column === event.target.name || columns.includes(column)
)
availableColumns
.filter(
column =>
column.source === event.target.name ||
columns.includes(column.source)
)
.map(column => column.source)
);
} else {
setColumns(columns.filter(name => name !== event.target.name));
Expand Down

0 comments on commit e961cea

Please sign in to comment.