callstack / callstack/react-native-paper
Expose adjustsFontSizeToFit as new prop for Button
- Dominant language
- TypeScript
- Stars
- 14.5k
- Forks
- 2.2k
- Avg merge
- 5d 23h
- Merged PRs (30d)
- 12
Description
**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
Contributor guide
Research direction
Start at the Button implementation that renders the Text label, then review the context of pull request #4125. Expose adjustsFontSizeToFit as a Button prop and verify that the label remains visible on iOS when the text would otherwise be truncated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100