Padding on Text results in incorrect bounding box for press events
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- android, ios, react-native
- 領域
- mobile-dev
調査の方向性
必須の Expo Snack から始め、新アーキテクチャで iOS と Android の両方における padding のヒットテスト動作を再現します。次に、対象プラットフォームにおける React Native Text の press 処理とバウンディングボックスの計算を追跡します。padding 内をタップしても press が発生せず、テキスト上をタップした場合は引き続き発生することを、両プラットフォームのリグレッションテストでカバーできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
When adding padding to a <Text /> element, onPress event are caught in the padding area on iOS rather than the text itself.
On Android, the text is clickable, but so is the padding area.
This happens with new architecture enabled.
Steps to reproduce
- Open the provided expo snack
- Click above the "Click me!" text
- Alert should come up
- Click the "Click me!" text
- This time no alert comes up
React Native Version
0.81.4
Affected Platforms
Runtime - iOS, Runtime - Android
Output of npx @react-native-community/cli info
System:
OS: macOS 15.6.1
CPU: (14) arm64 Apple M4 Pro
Memory: 169.70 MB / 48.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.19.0
path: ~/.nvm/versions/node/v22.19.0/bin/node
Yarn:
version: 1.22.22
path: ~/.nvm/versions/node/v22.19.0/bin/yarn
npm:
version: 10.9.3
path: ~/.nvm/versions/node/v22.19.0/bin/npm
Watchman:
version: 2025.09.01.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.0
- iOS 18.0
- macOS 15.0
- tvOS 18.0
- visionOS 2.0
- watchOS 11.0
Android SDK:
API Levels:
- "29"
- "30"
- "31"
- "34"
- "35"
- "36"
Build Tools:
- 34.0.0
- 35.0.0
- 36.0.0
- 36.1.0
System Images:
- android-30 | Google APIs ARM 64 v8a
- android-36 | Google Play ARM 64 v8a
Android NDK: 29.0.14033849-beta4
IDEs:
Android Studio: 2025.1 AI-251.26094.121.2513.14007798
Xcode:
version: 16.0/16A242d
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.16
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /Users/giuseppebarillari/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 19.1.0
wanted: 19.1.0
react-native:
installed: 0.81.4
wanted: 0.81.4
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Stacktrace or Logs
None
MANDATORY Reproducer
https://snack.expo.dev/@joe2k01/text-onpress-padding-bounding-box
Screenshots and Videos
https://github.com/user-attachments/assets/c50f9f2e-c80d-4fb0-9ad2-04073c7d38d8
- 主要言語
- C++
- スター
- 127k
- フォーク
- 25.3k
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react/react-native のほかの issue
-
Needs: Author Feedback Needs: Repro
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
react/react-native#58621 · コメント 1 件 ·
-
Needs: Author Feedback Needs: Repro
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
react/react-native#58610 · コメント 1 件 ·
-
Needs: Triage :mag:
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
react/react-native#58565 · コメント 1 件 · リアクション 2 件 ·
-
Needs: Author Feedback Needs: Repro
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
react/react-native#58555 · コメント 4 件 · リアクション 1 件 ·
-
Needs: Attention Needs: Repro
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
react/react-native#58526 · コメント 2 件 ·
react/react-native の issue をすべて見る
似ている issue
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
QuantStack/git2cpp#187 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
mlcommons/mobile_app_open#1182 ·
-
Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/winget-cli#6547 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
AXERA-TECH/ax-llm#77 ·