[Android] KeyboardAwareScrollView causes content to disappear
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- android, react-native, typescript
- Domain
- mobile-dev
Research direction
Start with the linked demo repository and reproduce the issue using yarn install followed by yarn android. Compare the Android form sheet with fitToContents, an autofocus input, and KeyboardAwareScrollView against the standard ScrollView case described in the report. Done means the form sheet opens with its content visible under the reported conditions.
Written by the indexing model from the issue text.
Description
Description
This issue requires several different conditions but it is reproducible so I figured it was worth opening an issue for here.
Required conditions:
- Android (issue not present on iOS)
- A sheet with
fitToContentsdetent - A large amount of content exceeding the screen height
- A
KeyboardAwareScrollView(fromreact-native-keyboard-controller) containing an autofocus text input
When these conditions are present, the form sheet fails to open properly as the content "blows out" off screen. Closing and re-opening the keyboard causes the content to appear normally. Disabling autofocus prevents the issue from occurring. As does using a standard RN ScrollView
Admittedly I realize that putting a scroll view inside of a sheet without a fixed parent height could be problematic. But this also feels like something that shouldn't be able to occur. It almost seems like a race condition of some sort with the keyboard appearing at the same time while the initial layout is being calculated.
Another thing to note is that sometimes the issue does not occur on the first attempt after the app is opened. It happens consistently after that though.
https://github.com/user-attachments/assets/7a88e968-b054-4035-8ab6-f01e2509de2d
Steps to reproduce
- Clone the demo repo
- Run
yarn install - Run
yarn android - Tap the 'Open formsheet' button (might have to do this twice)
Snack or a link to a repository
https://github.com/iankberry/android-formsheet-fittocontents-issue
Screens version
4.23.0
React Native version
0.81.5 (Expo 54)
Platforms
Android
JavaScript runtime
None
Workflow
None
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
Android emulator
Device model
No response
Acknowledgements
Yes
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 714
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 71
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from software-mansion/react-native-screens
-
missing-repro platform:ios
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
software-mansion/react-native-screens#4168 · 10 comments · 2 reactions ·
-
area:stack-v4 platform:android
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
software-mansion/react-native-screens#3784 · 5 comments ·
-
cr:missing-info cr:missing-repro cr:platform:android missing-info missing-repro platform:android
Difficulty 4/5 3-5 days Newbie friendliness 42/100
software-mansion/react-native-screens#4677 · 4 comments ·
-
cr:missing-repro cr:platform:ios missing-repro platform:ios
software-mansion/react-native-screens#4671 · 3 comments · 1 assignee ·
-
cr:missing-info cr:missing-repro cr:platform:android missing-info missing-repro platform:android
software-mansion/react-native-screens#4664 · 3 comments · 1 assignee ·
All issues in software-mansion/react-native-screens
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·