Skip to content
Open
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
4 changes: 4 additions & 0 deletions packages/pluggableWidgets/image-web/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

- We fixed an issue where showing icons as datasource would scale the icon container disproportionately and cause alignment issues.

## [1.5.0] - 2025-08-29

### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/pluggableWidgets/image-web/src/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const Image: FunctionComponent<ImageContainerProps> = props => {
const { type, image } = getImageProps(props);

const altText = props.alternativeText?.status === ValueStatus.Available ? props.alternativeText.value : undefined;
const styleObject = constructStyleObject(props);
const styleObject = type === "image" && constructStyleObject(props);

const imageStyle = { ...props.style, ...styleObject };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export const Image: FunctionComponent<ImageProps> = ({
<ImageUi.Wrapper
className={className}
responsive={responsive}
type={type}
hasImage={image !== undefined && image.length > 0}
>
{content}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface ImageWrapperProps {
className?: string;
responsive: boolean;
hasImage: boolean;
type: string;
children:
| ReactElement<ImageContentIcon | ImageContentImage>
| [ReactElement<ImageContentIcon | ImageContentImage>, ReactElement<LightboxProps> | false];
Expand All @@ -37,6 +38,7 @@ function Wrapper(props: ImageWrapperProps): ReactElement {
className={classNames(
"mx-image-viewer",
{ "mx-image-viewer-responsive": props.responsive },
{ "mx-image-viewer-icon": props.type === "glyph" || props.type === "icon" },
props.className,
{ hidden: !props.hasImage }
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports[`Image renders the structure as a background image 1`] = `
exports[`Image renders the structure with a glyph icon 1`] = `
<DocumentFragment>
<div
class="mx-image-viewer mx-image-viewer-responsive"
class="mx-image-viewer mx-image-viewer-responsive mx-image-viewer-icon"
>
<span
class="glyphicon-asterisk glyphicon"
Expand All @@ -30,7 +30,7 @@ exports[`Image renders the structure with a glyph icon 1`] = `
exports[`Image renders the structure with an icon 1`] = `
<DocumentFragment>
<div
class="mx-image-viewer mx-image-viewer-responsive"
class="mx-image-viewer mx-image-viewer-responsive mx-image-viewer-icon"
>
<span
class="mx-icon mx-icon-asterisk"
Expand Down
3 changes: 3 additions & 0 deletions packages/pluggableWidgets/image-web/src/ui/Image.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.mx-image-viewer {
width: 100%;
height: 100%;
&-icon {
height: unset;
}
}

.mx-image-viewer-responsive img {
Expand Down
Loading