callstack / callstack/react-native-paper

Cannot increase Button label's font size without throwing off labels vertical alignment

オープン
#4,695 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
TypeScript
スター
14.5k
フォーク
2.2k
平均マージ
5日 23時間
マージ済み PR(30日)
12

説明

### Current behaviour
The button labels font size doesn't scale for large devices, you have a tiny label that looks unlike anything else on the screen... you can't increase the font size or the vertical alignment of the label is lost.
We tried patching this ourselves but the button itself is coded like a complete rats nest, full of magic numbers and strange floating views layed on top of other views. Why this is needed for a button that still doesn't work remains a mystery but perhaps the framework designers can figure it out.

Adjusting the button height does nothing to fix the vertical alignment either.
Ideally we'd like to be able to increase the button height AND increase the font size, but we could live with thin frail buttons if their labels just looked semi-normal.

We'd even settle for react-native-paper resizing the label itself, and providing a simple size prop i.e. "large" | "medium" | "small". Really we'd be okay with anything better than what we currently have.

![Image](https://github.com/user-attachments/assets/94ea8b15-3730-4ee5-a44a-57f9dc01720e)

As of now we're not even using react-native-paper's buttons since they make the entire app look sloppily done on any large device. Which these days is most devices. But this means we now have 2 UI frameworks installed, one for a simple button and the other for everything else.

### Expected behaviour
Just a simple button that looks normal on different devices.

### How to reproduce?
Create any project and add a button to it. Try making it look normal on large devices. You can't.

### What have you tried so far?
It's not my job to provide basic functionality

### Your Environment
It's not an environment problem.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

プロジェクトを作成し、react-native-paper のボタンを追加して、大きなデバイスでラベルのフォントサイズとボタンの高さの変更をテストすることで、問題を再現します。issue にはソースファイルやテストが記載されていません。ボタンとラベルをデバイス間でサイズ変更でき、ボタンのラベルが垂直方向に整列したままになると、作業は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react-native
領域
frontend, mobile
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。