Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Horizontal ScrollView doesn't update its width on children update #36845

Closed
sergionsz opened this issue Apr 6, 2023 · 5 comments
Closed
Labels
Component: ScrollView Needs: Triage 🔍 Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@sergionsz
Copy link

Description

On Android, after scrolling all the way to the end, when removing an item from a horizontal ScrollView, the width of the ScrollView doesn't update, leaving empty space at the end

How it looks on Android
Android

How it looks on iOS
ios

You can see it in action here

React Native Version

0.70.8

Output of npx react-native info

System:
OS: macOS 13.0
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 226.39 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.18.2 - ~/.volta/tools/image/node/14.18.2/bin/node
Yarn: 1.22.10 - ~/.volta/tools/image/yarn/1.22.10/bin/yarn
npm: 6.14.15 - ~/.volta/tools/image/node/14.18.2/bin/npm
Watchman: 2023.01.23.00 - /usr/local/bin/watchman
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 23, 29, 30, 33
Build Tools: 28.0.2, 28.0.3, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 31.0.0, 33.0.0
System Images: android-28 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom_64, android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9014738
Xcode: 14.1/14B47b - /usr/bin/xcodebuild
Languages:
Java: 11.0.13 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.8 => 0.70.8
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  • Create a horizontal ScrollView
  • Open on Android
  • Scroll to the end
  • Remove some children

Snack, code example, screenshot, or link to a repository

https://snack.expo.dev/9BvcfYiY0?platform=android

@atulbrydotintuit
Copy link

atulbrydotintuit commented Apr 14, 2023

Your native components doesn't re-render on Click handler.
You can try solution mentioned in expo:
https://snack.expo.dev/2HoHaKK8k

If you wanna stay at same place you can use scrollTo() method of Scrollview or if you want to be at bottom of scrollview scrollToEnd()

@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 12, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@Navipro70
Copy link

Do we have a solution except scrollToEnd()?

@rankangkang
Copy link

rankangkang commented Sep 24, 2024

🤔 It seems to work well on iOS, but this issue occurs on Android. Manually triggering scrollTo while children update might be a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ScrollView Needs: Triage 🔍 Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

4 participants