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

[EuiPanel] Add missing Emotion styles when panel render as button #6010

Merged
merged 3 commits into from
Jun 29, 2022
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
8 changes: 8 additions & 0 deletions src/components/panel/__snapshots__/panel.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[` 1`] = `
<button
aria-label="aria-label"
class="euiPanel euiPanel--plain euiPanel--paddingMedium testClass1 testClass2 emotion-euiPanel-grow-m-m-plain-hasShadow-isClickable"
data-test-subj="test subject string"
/>
`;

exports[`EuiPanel is rendered 1`] = `
<div
aria-label="aria-label"
Expand Down
8 changes: 8 additions & 0 deletions src/components/panel/panel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,13 @@ describe('EuiPanel', () => {
});
});
});

describe('onClick', () => {
const component = render(
<EuiPanel {...requiredProps} onClick={jest.fn()} />
);

expect(component).toMatchSnapshot();
});
});
});
1 change: 1 addition & 0 deletions src/components/panel/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export const EuiPanel: FunctionComponent<EuiPanelProps> = ({
<button
ref={panelRef as Ref<HTMLButtonElement>}
className={classes}
css={cssStyles}
{...(rest as ButtonHTMLAttributes<HTMLButtonElement>)}
>
{children}
Expand Down
3 changes: 3 additions & 0 deletions upcoming_changelogs/6010.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Bug fixes**

Fixed issue with `EuiPanel` where the `Emotion` styles were not being passed when it was rendered as a button