-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avatar ignoring resize mode on initial load #3867
Comments
As per my understanding of the issue, the Avatar component of the library is not working as it is intended to be. The resize mode property for images is working after the initial load but not on the initial load. Am I correct? |
@dishant-yadav yes but for some reason only on this avatar component the rest of my components seem to be working normally |
@KrisLau So are you planning to work on this issue? |
@dishant-yadav I could but I have no clue what the issue is at all especially since it's only that one specific avatar that is messed up and none of the rest |
By one specific avatar, do you mean that one of of the avatar |
@dishant-yadav Yes just that one in that one screen. The ones I have in other screens seem to be working fine |
Isn't that strange. Do you mean that the same avatar component works differently on other screens? |
@dishant-yadav Can't avoid upgrading now, so I just worked around the issue by manually resizing the image file to be slightly smaller than the avatar container |
Ok not sure what happened but now it's happening to all of the avatars and changing the image component to |
How come this is happening? Did you change the version since then? |
@dishant-yadav Not sure i might've just not noticed the change on the other avatars since the rest use more similarly sized images but yeah not sure what caused it still. I tried looking at the source code and didn't see anything that stuck out |
@dishant-yadav Ok super weird new thing I noticed. Deployed to TestFlight and noticed that on physical devices, that workaround does not work. |
Are you able to find the cause of the error? |
@dishant-yadav source && (React.createElement(Image, Object.assign({ testID: "RNE__Avatar__Image", containerStyle: imageContainerStyle, source: source, borderRadius: rounded ? width / 2 : undefined }, imageProps, { style: StyleSheet.flatten([
styles.avatar,
imageProps && imageProps.style,
avatarStyle,
]), ImageComponent: ImageComponent }))),
Nevermind i tried patching it in the package and that didn't work. Honestly I have no clue. Have you been able to reproduce the issue? |
ok so i spent the past day troubleshooting this and I believe adding the height and width to the Image component fixes it on my personal custom component that mimics the Avatar component: <Image
source={source}
borderRadius={rounded ? width / 2 : undefined}
style={[
styles.avatar,
{borderRadius: containerStyle?.borderRadius ?? undefined},
imageProps && imageProps.style,
avatarStyle,
{height, width}, //here
]}
containerStyle={imageContainerStyle} However I'm not sure if this might mess with other people's implementation |
@dishant-yadav Any updates from the RNE end? |
No I don't think so. @KrisLau |
Hey @KrisLau I was testing it on this snack, and it seems to be working fine on |
Hi, i encountered this issue today when using the avatar component with a very large image, trying to set Indeed, adding the width and height to the image generated by the avatar component fixes the issue. Using: rneui 4.0.0-rc8 Here's my patch-package file till this gets fixed:
|
Is there an existing issue for this?
Explain what you did
Updated some packages and then when I was testing the app I noticed this problem
Expected behavior
react-native-image-picker
Describe the bug
It's completely not following the
resizeMode
If i pick a new image using react-native-image-picker that new image follows the
resizeMode
Steps To Reproduce
Screenshots
Your Environment
`npx @rneui/envinfo`
The text was updated successfully, but these errors were encountered: