Using a Chip
in a Card
's subtitle
breaks card height on iOS
#4021
Labels
Chip
in a Card
's subtitle
breaks card height on iOS
#4021
Current behaviour
When using a
Chip
component in thesubtitle
prop of aCard.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](https://private-user-images.githubusercontent.com/47901316/259619055-5caf9619-e112-43b2-b1fa-b4681eb8ca65.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM0MDc4MTYsIm5iZiI6MTcyMzQwNzUxNiwicGF0aCI6Ii80NzkwMTMxNi8yNTk2MTkwNTUtNWNhZjk2MTktZTExMi00M2IyLWIxZmEtYjQ2ODFlYjhjYTY1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODExVDIwMTgzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYwNjg5MjA5MmUwMjM2ZmZjN2Y1ZWEyYWVkMjU3NGQwYjBjYmViMzMwZjdkYmQwMjJjZTIzZjhkOWJkY2ExNjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.veS4RuWm-yTEzW8yh5-CJNAkYivN453ZunlaCTIORZQ)
vs.
The expected card size (obtained by wrapping in a ScrollView):
![image](https://private-user-images.githubusercontent.com/47901316/259620608-e39413a2-d24e-47f8-a924-d463da3f3081.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM0MDc4MTYsIm5iZiI6MTcyMzQwNzUxNiwicGF0aCI6Ii80NzkwMTMxNi8yNTk2MjA2MDgtZTM5NDEzYTItZDI0ZS00N2Y4LWE5MjQtZDQ2M2RhM2YzMDgxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODExVDIwMTgzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY3ODg0NTlkZDI4ZjUzZjhiODhkYzMxMjBmZjIzYjAwOTI5MmMwMzc1ODI4OTgwMjgyMDZjYjU2NDE0NmNjNzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.oXD1I0k3KL9wYV7Mb3SRaxOIAtdnVO1LuiypJzQPivg)
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
The text was updated successfully, but these errors were encountered: