Skip to content

Commit

Permalink
Merge pull request #8995 from marmelab/fix-list-children-css-class
Browse files Browse the repository at this point in the history
Fix ListView does not apply CSS classes to its child components
  • Loading branch information
slax57 committed Jun 12, 2023
2 parents 39a517e + d86cf55 commit 955b1bb
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions packages/ra-ui-materialui/src/list/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const ListView = <RecordType extends RaRecord = any>(
<div className={ListClasses.main}>
{(filters || actions) && (
<ListToolbar
className={ListClasses.actions}
filters={filters}
actions={actions}
hasCreate={hasCreate}
Expand All @@ -78,7 +79,8 @@ export const ListView = <RecordType extends RaRecord = any>(
);

const renderEmpty = () =>
empty !== false && cloneElement(empty, { hasCreate });
empty !== false &&
cloneElement(empty, { className: ListClasses.noResults, hasCreate });

const shouldRenderEmptyPage =
!isLoading &&
Expand Down Expand Up @@ -163,12 +165,7 @@ const Root = styled('div', {
overflow: 'inherit',
},

[`& .${ListClasses.actions}`]: {
zIndex: 2,
display: 'flex',
justifyContent: 'flex-end',
flexWrap: 'wrap',
},
[`& .${ListClasses.actions}`]: {},

[`& .${ListClasses.noResults}`]: { padding: 20 },
[`& .${ListClasses.noResults}`]: {},
}));

0 comments on commit 955b1bb

Please sign in to comment.