callstack / callstack/react-native-paper
RadioButton.Item / Checkbox.Item additional props for <Text> element
- 主要语言
- TypeScript
- 星标
- 14.5k
- 派生
- 2.2k
- 平均合并
- 5 天 23 小时
- 30 天内合并 PR
- 12
描述
Version: `5.11.0`
When using the RadioButton.Item and Checkbox.Item components, I cannot find a way to pass through props for the underlying component used for the labels, such as `adjustsFontSizeToFit`, `allowFontScaling` and `numberOfLines`.
This make it difficult to cater for longer label names, especially when dealing with different device sizes and OS text scaling options in Android. At present they are simply cut off, without any indication that the text continues.
Implementation options could include:
1. Provide a `labelTextProps` prop, which would allow passing through props to the component, similar to the way `labelStyle` is offered to pass through additional styles
2. Allow the current `label` prop to be either a string or a ReactNode so that users can override the implementation with something of their own creation
贡献指南
调研方向
Start at the RadioButton.Item and Checkbox.Item component entry points and inspect how their label and labelStyle props reach the underlying Text element. Compare both implementations, then verify that the requested text props or custom label rendering work for longer labels and text scaling without breaking existing usage.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- react-native, typescript
- 领域
- frontend, mobile
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100