Skip to content

Conversation

pardhan03
Copy link

Fixes #1395 : Extra Spacing in Gallery When Images and Files Are Attached

This PR addresses a UI issue where extra spacing was introduced around the gallery component when both images and files (e.g., image or documents) were attached in a single message.

🧩 Fix

  • Adjusted layout logic and spacing in FileAttachment.tsx.
  • Ensured that mixed media (files + images) render in a consistent and visually correct layout.

After Fix

solution

solution1

@khushal87
Copy link
Member

simulator_screenshot_765058C4-2104-426B-AD6C-BD52EC58D506

Hey the fix Doesn't seem to be correct as it trims the file attchment width to a very small one. I will look into it and try to add a new fix. Probably we need to center the image instead of playing with the file attachment height.

@pardhan03
Copy link
Author

@khushal87 I removed the maxWidth property and added flex: 1, so now the component takes up the full width of its parent. To control the minimum size, we can set a minWidth property. This way, it won’t shrink too small if the parent has limited space. However, when using minWidth, the image may end up with extra space around it depending on how it scales.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extra spacing around gallery when both images and files are attached in a message
2 participants