Skip to content

Don't show scrollbar if there isn't enough content - #34175

Merged
LongCatIsLooong merged 3 commits into
flutter:masterfrom
LongCatIsLooong:hide-scrollbar-when-not-enough-content
Jun 13, 2019
Merged

LongCatIsLooong merged 3 commits into
flutter:masterfrom
LongCatIsLooong:hide-scrollbar-when-not-enough-content

Conversation

@LongCatIsLooong

@LongCatIsLooong LongCatIsLooong commented Jun 10, 2019 •

Copy link
Copy Markdown
Contributor

Description

Don't show scrollbar if there isn't enough content for both material and cupertino.

Related Issues

Fixes #33635

Tests

I added the following tests:

  • should not paint when there isn't enough space (material)
  • should not paint when there isn't enough space (cupertino)

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@LongCatIsLooong LongCatIsLooong added framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. labels Jun 10, 2019

@Piinks Piinks left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Once Cirrus is happy :)

@Piinks Piinks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this test here is unhappy:

testWidgets('ScrollbarPainter does not divide by zero', (WidgetTester tester) async {

The test seems to expect a scrollbar here, but it appears the container isn't large enough to warrant one with this change. I think the test may need to be changed to reflect the new expected behavior.

@LongCatIsLooong
LongCatIsLooong merged commit 5f39487 into flutter:master Jun 13, 2019
@LongCatIsLooong
LongCatIsLooong deleted the hide-scrollbar-when-not-enough-content branch June 13, 2019 00:55
tango5614 added a commit to tango5614/flutter that referenced this pull request Jun 13, 2019
* master:
  More removing of timeouts. (flutter#33932)
  Update flakiness of tests (flutter#34374)
  Roll engine 67aadb6..209250d (4 commits) (flutter#34370)
  Don't show scrollbar if there isn't enough content (flutter#34175)
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scrollbar should not be visible when there isn't enough content to scroll, i.e. when content dimension <= view port dimension

3 participants