- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Card.Cover padding #4648
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
Comments
+1 Can reproduce. This is quite odd since Git blame shows this has been in the source code for 9 years |
For now I've just copied across from the source code and removed the padding and it works for my limited use cases |
Just to report I'm getting the same behaviour, but only on iOS, not on android.
|
I've just used a yarn patch to remove the padding. I have not noticed any other issues arising from this. diff --git a/src/components/Card/CardCover.tsx b/src/components/Card/CardCover.tsx
index 337de2a94402e3e82908e4b00cffcc9cef2bd97b..cc19fa788f54bb7cbee215906eb4078eb2f3ffc2 100644
--- a/src/components/Card/CardCover.tsx
+++ b/src/components/Card/CardCover.tsx
@@ -86,7 +86,9 @@ const styles = StyleSheet.create({
flex: 1,
height: undefined,
width: undefined,
- padding: 16,
+ // patched because of upstream bug:
+ // https://github.com/callstack/react-native-paper/issues/4648
+ // padding: 16,
justifyContent: 'flex-end',
},
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current behaviour
I upgraded from react native version 75.4 to 76.7 today. Since that a card component with a cover has weird padding around the cover image.
Expected behaviour
no padding around like before
How to reproduce?
My component looks like this currently
Preview
What have you tried so far?
Adding padding:0 to styles does nothing as it affects the View around the image and not the image itself. I looked into papers source code and found, that a padding of 16 is set on the image inside Card.Cover. I have no clue why this was not an issue before now.
Your Environment
The text was updated successfully, but these errors were encountered: