react / react/react-native

ScrollView horizontal scrolling breaks (unable to scroll to end) when using minWidth instead of width: Math.max(minWidth, ...)

オープン
#51,388 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Component: ScrollView Issue: Author Provided Repro
主要言語
C++
スター
127k
フォーク
25.3k
平均マージ
1日 23時間
マージ済み PR(30日)
4

説明

Description

When using minWidth on a horizontally scrolling ScrollView, the scrollable content does not allow scrolling all the way to the end. Replacing minWidth: 500 with a computed width: Math.max(width * 0.9, 500) resolves the issue, making the full content scrollable.

Steps to reproduce
  1. open the snack reproducer
  2. run on a device with viewport width < 500 (e.g. Pixel 8)
  3. try to scroll to the end to observe the last item being cut off
React Native Version

0.78.0

Affected Platforms

Runtime - iOS, Runtime - Android

Output of npx @react-native-community/cli info
System:
  OS: macOS 15.4.1
  CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Memory: 222.21 MB / 64.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.3.0
    path: /usr/local/bin/node
  Yarn: Not Found
  npm:
    version: 10.9.0
    path: /usr/local/bin/npm
  Watchman:
    version: 2025.03.10.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.4
      - iOS 18.4
      - macOS 15.4
      - tvOS 18.4
      - visionOS 2.4
      - watchOS 11.4
  Android SDK:
    API Levels:
      - "34"
      - "35"
    Build Tools:
      - 32.0.0
      - 33.0.0
      - 34.0.0
      - 35.0.0
    System Images:
      - android-30 | Google Play Intel x86 Atom
      - android-31 | Google APIs Intel x86_64 Atom
      - android-33 | Google Play Intel x86_64 Atom
      - android-34 | Intel x86_64 Atom
      - android-34 | Google APIs Intel x86_64 Atom
      - android-34 | Google Play Intel x86_64 Atom
      - android-35 | ARM 64 v8a
      - android-35 | Intel x86_64 Atom
      - android-35 | Google APIs Intel x86_64 Atom
      - android-35 | Google Play Intel x86_64 Atom
      - android-36 | Pre-Release 16 KB Page Size Google Play Intel x86_64 Atom
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.22562.218.2431.13114758
  Xcode:
    version: 16.3/16E140
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby:
    version: 3.3.5
    path: /usr/local/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.78.0
    wanted: 0.78.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
No crash/failure
MANDATORY Reproducer

https://snack.expo.dev/@alex_p8/calm-indigo-apples

Screenshots and Videos

Expected behavior (when scrolling to the end):
Image

Actual behavior (when scrolling to the end):
Image

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

必須の Snack 再現手順と、Android および iOS について説明されている ScrollView の動作から始めてください。minWidth: 500 を使用した水平スクロールと、計算された幅を使用する回避策を比較し、500 より狭い viewport を持つデバイスで最後の項目に完全に到達できれば、issue は完了とみなします。

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

評価

技術スタック
react-native
領域
mobile
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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