Repository navigation
Fix: Image shrinks while loading in carousel - #37739
Conversation
|
@abdulrahuman5196 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
There's an issue on mWeb Safari that the order of attachments in carousel is messed up. This issue already exists on Screen.Recording.2024-03-05.at.19.43.07-compressed.mov |
| <Image | ||
| source={{uri}} | ||
| style={contentSize ?? DEFAULT_IMAGE_DIMENSION} | ||
| style={[contentSize ?? DEFAULT_IMAGE_DIMENSION, !contentSize && {opacity: 0}]} |
There was a problem hiding this comment.
Kindly remove inline styles.
And contentSize ?? DEFAULT_IMAGE_DIMENSION why are we still setting DEFAULT_IMAGE_DIMENSION and hiding via opacity.
There was a problem hiding this comment.
Updated! Removed DEFAULT_IMAGE_DIMENSION fallback and used styles.opacity0.
We still need the default image size, otherwise Image's onLoad function wouldn't trigger.
invisibleImage: {
opacity: 0,
width: 200,
height: 200,
}|
@tienifr I am see loader shown for a moment even after the image is shown, even in your android video I am seeing the same. could you kindly check on this? |
That already happened in production app: video_2024-03-11_16-12-48.mp4I noticed the loading on simulator is a little bit (not considerably) longer, maybe because |
|
Reviewing now |
|
Bump @abdulrahuman5196. |
|
@abdulrahuman5196 Do we have any blocker? |
|
Hi, I will work on this today |
|
Sorry for the delay. I am reviewing now. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-03-18.at.10.59.19.PM.mp4Android: mWeb ChromeScreen.Recording.2024-03-18.at.11.09.24.PM.mp4iOS: NativeScreen.Recording.2024-03-18.at.10.51.15.PM.mp4iOS: mWeb SafariScreen.Recording.2024-03-18.at.10.52.11.PM.mp4MacOS: Chrome / SafariScreen.Recording.2024-03-18.at.9.43.16.PM.mp4MacOS: DesktopScreen.Recording.2024-03-18.at.9.45.05.PM.mp4 |
abdulrahuman5196
left a comment
There was a problem hiding this comment.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @iwiznia
🎀 👀 🎀
C+ Reviewed
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 1.4.55-0 🚀
|
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 1.4.55-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.55-3 🚀
|
Details
This PR hides the image while it's still loading and only shows the loading indicator then, to avoid the issue that image shrinks to default size (200x200) on native devices since its size is not known yet.
Fixed Issues
$ #35615
PROPOSAL: #35615 (comment)
Tests
Offline tests
NA
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2024-03-05.at.19.45.29-compressed.mov
Android: mWeb Chrome
Screen.Recording.2024-03-05.at.19.49.57-compressed.mov
iOS: Native
Screen.Recording.2024-03-05.at.19.42.15-compressed.mov
iOS: mWeb Safari
Screen.Recording.2024-03-05.at.19.43.07-compressed.mov
MacOS: Chrome / Safari
Screen.Recording.2024-03-05.at.19.51.34-compressed.mov
MacOS: Desktop
Screen.Recording.2024-03-05.at.19.51.34-compressed.mov