You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `AttachmentList` component displays the attachments of a message. The following attachments are supported:
7
8
@@ -51,9 +52,9 @@ The following section details how the width and height of images and videos uplo
51
52
52
53
You can control the maximum size of images and videos with the [`--str-chat__attachment-max-width`](../theming/component-variables.mdx) CSS variable (available only in [theme-v2](../theming/introduction.mdx)). The value of this variable must be a value that can be computed to a valid pixel value using the [`getComputedStyle`](https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle) method (for example: `300px`, `10rem`, `calc(300px - var(--margin))`, but not `100%`). If you provide an invalid value, the image and video sizing can break, which can lead to scrolling issues inside the message list (for example the message list isn't scrolled to the bottom when you open a channel).
53
54
54
-
:::tip
55
-
If you're unsure about the value you provided for `--str-chat__attachment-max-width`, send an image/video to a channel, then inspect the `img`/`video` element inside the message list using your browser's development tools. Inside the **computed** properties of the element, you should see that `max-height` and `max-width` are set to a valid pixel value.
56
-
:::
55
+
If you set an invalid value to the variable, you'll see a warning on the browser's console:
@@ -219,6 +227,11 @@ export class AttachmentConfigurationService<
219
227
}
220
228
}else{
221
229
sizeRestriction=undefined;
230
+
if(displayWarning){
231
+
console.warn(
232
+
`Invalid value set for height/max-height and/or max-width for HTML element, this can cause scrolling issues inside the message list, more info https://getstream.io/chat/docs/sdk/angular/components/AttachmentListComponent/#image-and-video-sizing`
0 commit comments