-
Notifications
You must be signed in to change notification settings - Fork 149
Remove horizontal scrollview indicator padding when empty #1635
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
Remove horizontal scrollview indicator padding when empty #1635
Conversation
…ent view is empty This was causing default padding when height was 0
These were both returning the same value so masked the bug
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.
Code analysis results:
eslint
found some issues. Runyarn lint --fix
to automatically fix problems.
Base commit: 2430d1f |
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.
Code analysis results:
eslint
found some issues. Runyarn lint --fix
to automatically fix problems.
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.
Code analysis results:
eslint
found some issues. Runyarn lint --fix
to automatically fix problems.
Can some of the refactoring of tests be pushed upstream so we can instead cherry-pick it to RN-macOS? Might help with reducing diffs :) |
On iOS, the vertical/horizontal scrollbar indicator overlays can both be toggled/displayed at the same time. CleanShot.2023-01-17.at.08.48.21.mp4On macOS, the horizontal scroll indicator will only be visible if the I think we should fork them & show both horizontal & vertical examples separately since the behavior is slightly different relative to the |
I also prefer keeping the iOS example to showcase the behavioral difference from macOS. Agreed with @Saadnajmi that we should upstream any applicable changes as much as possible to reduce diffs - is |
I'll revert the split out examples & try to upstream a better example to core. |
Try to upstream these to RN core instead
Summary: ## Sync OS changes for ScrollBar [[ScrollView] Don't always adjust content view padding for both scrollers microsoft#1132](microsoft#1132) [ScrollView - Respect the shows<Horizontal | Vertical>ScrollIndicator props on macOS microsoft#1135](microsoft#1135) [Remove horizontal scrollview indicator padding when empty microsoft#1635](microsoft#1635) [Add ScrollView Indicator Overlay style microsoft#1658](microsoft#1658) NOTE: This will override the "Always" user setting and force the scrollview to use the overlay style instead {F850963270} Test Plan: |ScrollView Overlay Style| |https://pxl.cl/2qp0D| |ScrollView works correctly| |https://pxl.cl/2qpd1| Reviewers: chpurrer, lefever Reviewed By: chpurrer Differential Revision: https://phabricator.intern.facebook.com/D42637723
…1635) * Don't compute additional horizontal padding for indicator if the content view is empty This was causing default padding when height was 0 * Switch the horizontal/vertical scroller size These were both returning the same value so masked the bug * Split up inset examples to be vertical/horizontal * Refactor scroll indicator examples into macOS specific examples * Add back deleted example * Use ContentSize to measure scrollview content height * Remove unused var * Fix lint * Remove ios ScrollIndicatorExample from rn tester * Revert broken out scroll indicator changes to `ScrollViewExample.js` Try to upstream these to RN core instead * Use correct macOS tags Co-authored-by: Shawn Dempsey <shawndempsey@fb.com> Co-authored-by: chiuam <67026167+chiuam@users.noreply.github.com> Co-authored-by: Saad Najmi <sanajmi@microsoft.com>
Summary: ## Sync OS changes for ScrollBar [[ScrollView] Don't always adjust content view padding for both scrollers microsoft#1132](microsoft#1132) [ScrollView - Respect the shows<Horizontal | Vertical>ScrollIndicator props on macOS microsoft#1135](microsoft#1135) [Remove horizontal scrollview indicator padding when empty microsoft#1635](microsoft#1635) [Add ScrollView Indicator Overlay style microsoft#1658](microsoft#1658) NOTE: This will override the "Always" user setting and force the scrollview to use the overlay style instead {F850963270} Test Plan: |ScrollView Overlay Style| |https://pxl.cl/2qp0D| |ScrollView works correctly| |https://pxl.cl/2qpd1| Reviewers: chpurrer, lefever Reviewed By: chpurrer Subscribers: generatedunixname89002005327315 Differential Revision: https://phabricator.intern.facebook.com/D42637723
Please select one of the following
Summary
Empty horizontal scrollview. Padding in red
CleanShot.2023-01-17.at.10.10.04.mp4
Changelog
[macOS] [FIXED] - Remove horizontal scrollview indicator padding when empty
Test Plan
When scrollview is empty (content removed), the scrollview is not visible
CleanShot.2023-01-12.at.22.11.03.mp4