Skip to content

Commit

Permalink
[EuiImage] Fix wrapperProps.css overriding EUI css
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Jun 30, 2023
1 parent 2181854 commit e8c1018
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/image/__snapshots__/image.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ exports[`EuiImage props wrapperProps 1`] = `
<figure
alt=""
aria-label="aria-label"
class="euiImageWrapper testClass1 testClass2 emotion-euiTestCss"
class="euiImageWrapper testClass1 testClass2 emotion-euiImageWrapper-euiTestCss"
data-test-subj="test subject string"
src="/cat.jpg"
style="border:2px solid red"
Expand Down
3 changes: 2 additions & 1 deletion src/components/image/image_wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,17 @@ export const EuiImageWrapper: FunctionComponent<EuiImageWrapperProps> = ({
margin && styles[margin],
allowFullScreen && styles.allowFullScreen,
isFullWidth && styles.fullWidth,
wrapperProps?.css,
];

const [optionalCaptionRef, optionalCaptionText] = useInnerText();

return (
<figure
aria-label={optionalCaptionText}
css={cssFigureStyles}
{...wrapperProps}
className={classes}
css={cssFigureStyles}
>
{allowFullScreen ? (
<>
Expand Down

0 comments on commit e8c1018

Please sign in to comment.