callstack / callstack/react-native-paper
iOS SegmentedButtons display color issue with decreased/increased phone text size
- Langage dominant
- TypeScript
- Étoiles
- 14.5k
- Forks
- 2.2k
- Merge moyen
- 5 j 23 h
- PR mergées (30 j)
- 12
Description
### Current behaviour
When changing the text size of my phone, certain text sizes cause a break in the background and border color in the SegmentedButtons component.
### Expected behaviour
Consistent SegmentedButtons styling no matter which phone text size is being used.
### How to reproduce?
On iOS: Settings > Accessibility > Display & Text Size > Larger Text
Select one of the following text size options:
Implementation:
```
```
### Preview
The button on the left has a band of lighter color, whether selected or not:
### What have you tried so far?
Explicitly setting a button labelStyle with the following (does not work for all phone text size options):
```
const { fontScale } = Dimensions.get('window');
const baseFontSize = theme.fonts.bodyMedium.fontSize || 14;
```
```
labelStyle: [styles.buttonLabel, { fontSize: Math.max(12, baseFontSize * fontScale) }]
```
```
const styles = StyleSheet.create({
buttonLabel: {
includeFontPadding: true,
textAlign: 'center',
textAlignVertical: 'center',
},
});
```
### Your Environment
| software | version
| --------------------- | -------
| ios | 18.6.2
| react-native | ^0.75.5
| react-native-paper | ^5.14.5
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par reproduire l’exemple de SegmentedButtons sur iOS avec les réglages Larger Text indiqués, puis examinez le style de SegmentedButtons et le comportement de labelStyle. Le travail est considéré comme terminé lorsque les couleurs d’arrière-plan et de bordure restent cohérentes pour les boutons sélectionnés et non sélectionnés avec les tailles de texte concernées, et que les vérifications ou tests correspondants réussissent.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- ios, react-native, typescript
- Domaine
- frontend, mobile
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 55/100