-
Notifications
You must be signed in to change notification settings - Fork 2.7k
MM-13099 Use size_aware_image component for when loading images in posts #2334
Conversation
@asaadmahmood We have an issue with One solution we thought is to have a fixed height and let the width scale to keep the aspect ratio. Ex: The above svg has 150px fixed height The other solution is to show it as attachments instead of preview for images as most platforms do to avoid this problem. Let me know if you have any suggestions or solutions for fixing this. |
@sudheerDev Maintaining a fixed height solution for the svgs make sense, we can keep the max height at 150px, or whatever the maximum height is to avoid a scrollpop. |
|
Spinmint test server created at: https://i-0ba2cdcfd45b19a72.test.spinmint.com Test Admin Account: Username: Test User Account: Username: Instance ID: i-0ba2cdcfd45b19a72 |
Waiting for a fix that will be on server end to clean up svg issue here. |
… images in webapp. * Removing getFileDimensionsForDisplay in favour of SizeAwareImage as it would be reliable in preventing scroll pop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
…sts (mattermost#2334) * MM-13099 Use size_aware_image component for all instances for loading images in webapp. * Removing getFileDimensionsForDisplay in favour of SizeAwareImage as it would be reliable in preventing scroll pop * Add a fallback for svg as older version do not have dimentions MM-14500 Fix for pop caused by size_aware_image * Use svg for creating placeholder instead of canvas and dataUrl Change to inline-block for hover css shadow effect Add defensive check for dimensions Removing display: inline-flex as it causes svg in the placeholder to not take the available space Have to move border hioghlight to img tags as div is display block by default so shows border for the entire box instead of just the image Update snapshots and fix lint
…sts (mattermost#2334) * MM-13099 Use size_aware_image component for all instances for loading images in webapp. * Removing getFileDimensionsForDisplay in favour of SizeAwareImage as it would be reliable in preventing scroll pop * Add a fallback for svg as older version do not have dimentions MM-14500 Fix for pop caused by size_aware_image * Use svg for creating placeholder instead of canvas and dataUrl Change to inline-block for hover css shadow effect Add defensive check for dimensions Removing display: inline-flex as it causes svg in the placeholder to not take the available space Have to move border hioghlight to img tags as div is display block by default so shows border for the entire box instead of just the image Update snapshots and fix lint
…sts (mattermost#2334) * MM-13099 Use size_aware_image component for all instances for loading images in webapp. * Removing getFileDimensionsForDisplay in favour of SizeAwareImage as it would be reliable in preventing scroll pop * Add a fallback for svg as older version do not have dimentions MM-14500 Fix for pop caused by size_aware_image * Use svg for creating placeholder instead of canvas and dataUrl Change to inline-block for hover css shadow effect Add defensive check for dimensions Removing display: inline-flex as it causes svg in the placeholder to not take the available space Have to move border hioghlight to img tags as div is display block by default so shows border for the entire box instead of just the image Update snapshots and fix lint
…sts (mattermost#2334) * MM-13099 Use size_aware_image component for all instances for loading images in webapp. * Removing getFileDimensionsForDisplay in favour of SizeAwareImage as it would be reliable in preventing scroll pop * Add a fallback for svg as older version do not have dimentions MM-14500 Fix for pop caused by size_aware_image * Use svg for creating placeholder instead of canvas and dataUrl Change to inline-block for hover css shadow effect Add defensive check for dimensions Removing display: inline-flex as it causes svg in the placeholder to not take the available space Have to move border hioghlight to img tags as div is display block by default so shows border for the entire box instead of just the image Update snapshots and fix lint
…sts (mattermost#2334) * MM-13099 Use size_aware_image component for all instances for loading images in webapp. * Removing getFileDimensionsForDisplay in favour of SizeAwareImage as it would be reliable in preventing scroll pop * Add a fallback for svg as older version do not have dimentions MM-14500 Fix for pop caused by size_aware_image * Use svg for creating placeholder instead of canvas and dataUrl Change to inline-block for hover css shadow effect Add defensive check for dimensions Removing display: inline-flex as it causes svg in the placeholder to not take the available space Have to move border hioghlight to img tags as div is display block by default so shows border for the entire box instead of just the image Update snapshots and fix lint
* MM-13099 Use size_aware_image component for when loading images in posts (#2334) * MM-13099 Use size_aware_image component for all instances for loading images in webapp. * Removing getFileDimensionsForDisplay in favour of SizeAwareImage as it would be reliable in preventing scroll pop * Add a fallback for svg as older version do not have dimentions MM-14500 Fix for pop caused by size_aware_image * Use svg for creating placeholder instead of canvas and dataUrl Change to inline-block for hover css shadow effect Add defensive check for dimensions Removing display: inline-flex as it causes svg in the placeholder to not take the available space Have to move border hioghlight to img tags as div is display block by default so shows border for the entire box instead of just the image Update snapshots and fix lint * Fix review comments
…sts (mattermost#2334) * MM-13099 Use size_aware_image component for all instances for loading images in webapp. * Removing getFileDimensionsForDisplay in favour of SizeAwareImage as it would be reliable in preventing scroll pop * WIP changes for svg pop * Fix snapshots * Add a fallback for svg as older version do not have dimentions * Revert package-lock change
* MM-13099 Use size_aware_image component for when loading images in posts (mattermost#2334) * MM-13099 Use size_aware_image component for all instances for loading images in webapp. * Removing getFileDimensionsForDisplay in favour of SizeAwareImage as it would be reliable in preventing scroll pop * Add a fallback for svg as older version do not have dimentions MM-14500 Fix for pop caused by size_aware_image * Use svg for creating placeholder instead of canvas and dataUrl Change to inline-block for hover css shadow effect Add defensive check for dimensions Removing display: inline-flex as it causes svg in the placeholder to not take the available space Have to move border hioghlight to img tags as div is display block by default so shows border for the entire box instead of just the image Update snapshots and fix lint * Fix review comments
Summary
preventing scroll pop
Ticket Link
MM-13099
MM-13158
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
make check-style
to check for style errors (required for all pull requests)make test
to ensure unit and component tests passed