Refactor vertical scrollbar to only be visible when text content overflows #1438
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please select one of the following
Summary
#1366 Added a vertical scrollbar to all Multiline TextInputs. This change caused some visual regression since it was showing scrollbars even if the text content did not overflow the view.
There are also instances where we don't want the vertical scrollbar to be visible. For this edge case we can pass
hideVerticalScrollIndicator
to always hide the scrollbar.NOTE #1244 Adds support for disabling scrollview. Once that PR is merged, I will update this to also not show the vertical scrollbar when scrolling is disabled.
Fixes #1368
Changelog
hideVerticalScrollIndicator
is passed as prop[Fixed] [macOS] - Optionally hide the vertical scrollbar & only display when text overflows containing view
Test Plan
Pasting text that overflows container view
CleanShot.2022-09-26.at.18.14.59.mp4
Input has pre-populated value that overflows container view
CleanShot.2022-09-26.at.18.16.41.mp4
Input has pre-populated value that does not overflow container view
CleanShot.2022-09-26.at.18.17.10.mp4
passing
hideVerticalScrollIndicator
prop astrue
will always hide the vertical scrollbarCleanShot.2022-09-26.at.18.19.19.mp4