callstack / callstack/react-native-paper

Expose adjustsFontSizeToFit as new prop for Button

未关闭
#4,854 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Button feature request
主要语言
TypeScript
星标
14.5k
派生
2.2k
平均合并
5 天 23 小时
30 天内合并 PR
12

描述

**Is your feature request related to a problem? Please describe.**
On some devices button text gets truncated due to `numberOfLines={1}` being applied to the `Text` label.

**Describe the solution you'd like**
`adjustsFontSizeToFit` exists and provides an easy way to keep the entire label visible.

**Describe alternatives you've considered**
I have attempted to do this myself by passing a `Text` element as a child to the button like so:
```


{text}

```
This unfortunately did not work. Only by editing the `Button` itself did iOS respect the `adjustsFontSizeToFit` prop.
**Additional context**
It looks like there is an existing pull request for this (although it's missing context):
#4125

贡献指南

打开贡献指南

调研方向

从渲染 Text 标签的 Button 实现入手,然后查看 pull request #4125 的上下文。将 adjustsFontSizeToFit 暴露为 Button prop,并验证当文本原本会被截断时,标签在 iOS 上仍保持可见。

由索引模型根据 Issue 内容生成。

评估

技术栈
react-native, typescript
领域
mobile
Issue 类型
功能
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。