Skip to content

Commit 3d25484

Browse files
fix(CatalogTile): Always render header when an onClick is passed
1 parent e060bf2 commit 3d25484

5 files changed

Lines changed: 94 additions & 90 deletions

File tree

packages/module/patternfly-docs/generated/extensions/catalog-view/catalog-tile/react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const pageData = {
9393
"name": "id",
9494
"type": "any",
9595
"description": "Id",
96-
"defaultValue": "getUniqueId('pf-catalog-tile-')"
96+
"defaultValue": "getUniqueId('pf-catalog-tile')"
9797
},
9898
{
9999
"name": "onClick",

packages/module/src/components/CatalogTile/CatalogTile.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ test('CatalogTile onClick behaves properly', async () => {
120120
/>
121121
);
122122

123-
await user.click(screen.getByText('Patternfly'));
123+
// await user.click(screen.getByText('Patternfly'));
124+
await user.click(screen.getByRole('radio'));
124125
expect(onClickMock).toHaveBeenCalled();
125126
});

packages/module/src/components/CatalogTile/CatalogTile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export class CatalogTile extends React.Component<CatalogTileProps> {
111111
isClickable={!!onClick}
112112
{...props}
113113
>
114-
{(badges.length > 0 || iconImg || iconClass || icon) && (
114+
{(badges.length > 0 || iconImg || iconClass || icon || onClick) && (
115115
<CardHeader
116116
actions={{ actions: badges.length > 0 && this.renderBadges(badges) }}
117117
selectableActions={

0 commit comments

Comments
 (0)