-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix Mobile Web Scrolling in OptionsList #2101
Conversation
The commit with message "found better solution" doesn't actually work, that's why I reverted it. @nickmurray47 if your iOS/Android dev env works do you mind testing it on those platforms and updating the OP? Also, I know this solution isn't super ideal (it's pretty confusing/janky), so I'll dig deeper when I have more time next week if you're not satisfied with this! We could deploy this in the meantime since it is breaking some pretty core functionality, so let me know what your thoughts are on this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change LGTM
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
||
// need to set a height (0 works in this case) so that the view will scroll on mobile | ||
// NOTE: the view will still fill its container since it has flex: 1 on it | ||
<View style={[styles.flex1, {height: 0}]}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads up, inline styles are not permitted this should probably be moved to sizing.js
.
Why does this work exactly? 🤔
I'm pretty confused about why
It's nice that this doesn't break anything, but yes, it would be ideal to avoid solutions that don't have clear explanations. This one is pretty bad because it defies reason and doesn't make much sense. If the An alternative here could be to use the device height available in |
Details
For some reason, the outer View in the OptionsList grows to fill the entire length of it's children on mobile (and therefore overflows the page), and therefore prevents scrolling.
I added
height: 0
to this View (it still grows to fill its container since it hasflex: 1
) so that it doesn't overflow the document body. Ideally we can find a better solution that isn't as confusing/janky, I'll dig deeper when I have more time.I've been unable to test it on iOS/Android (my dev env is broken), but I can verify that this doesn't break anything on Web, Mobile-Web, and Desktop.
Fixed Issues
Fixes https://github.com/Expensify/Expensify/issues/158391
Fixes https://github.com/Expensify/Expensify/issues/158390
Tests
Tested On
Screenshots
Mobile Web
mobile_web_demo.mp4
Web
web_demo.mp4
Desktop
desktop_demo.mp4