Skip to content
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

Using a Chip in a Card's subtitle breaks card height on iOS #4021

Closed
thehale opened this issue Aug 10, 2023 · 1 comment
Closed

Using a Chip in a Card's subtitle breaks card height on iOS #4021

thehale opened this issue Aug 10, 2023 · 1 comment
Labels

Comments

@thehale
Copy link

thehale commented Aug 10, 2023

Current behaviour

When using a Chip component in the subtitle prop of a Card.Title, the whole card suddenly fills its entire container instead of maintaining its traditional size.

This behavior only seems to manifest itself on iOS, while Android and Web appear unaffected.

Of the other currently open issues, only #3943 seems potentially related.

Expected behaviour

I would hope for the Card to continue rendering at its normal size, even when placing custom JSX in the title/subtitle props.

How to reproduce?

https://snack.expo.dev/@thehale/react-native-paper-card-issue?platform=ios

Preview

The full-screen Card on iOS:
image

vs.

The expected card size (obtained by wrapping in a ScrollView):
image

What have you tried so far?

Using plain text in the subtitle instead of a Chip fixes the sizing issue. Wrapping the Card in a ScrollView also allows it to render as expected, even with a Chip in the subtitle prop. (Also demonstrated in the Snack linked above).

Your Environment

software version
ios 15.7.7
android 10
react-native 0.71.11
react-native-paper 5.9.1
node v20.3.0
npm or yarn (yarn) 1.22.19
expo sdk 0.48.0
@thehale thehale added the bug label Aug 10, 2023
@thehale
Copy link
Author

thehale commented Aug 10, 2023

Closing because, while drafting this issue, I realized that the latest version of react-native-paper fixes this bug, likely thanks to #3994.

I decided to post the issue anyway to help anyone else who runs into this same error but hasn't yet upgraded to 5.10.1.

@thehale thehale closed this as completed Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant