Skip to content
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

[Tabs] Vertically hug content in sizeThatFits: #7777

Merged
merged 1 commit into from Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/Tabs/src/TabBarView/MDCTabBarView.m
Expand Up @@ -556,7 +556,7 @@ - (CGSize)intrinsicContentSizeForScrollableLayout {

- (CGSize)sizeThatFits:(CGSize)size {
CGSize intrinsicSize = self.intrinsicContentSize;
return CGSizeMake(MAX(intrinsicSize.width, size.width), MAX(intrinsicSize.height, size.height));
return CGSizeMake(MAX(intrinsicSize.width, size.width), intrinsicSize.height);
}

#pragma mark - Helpers
Expand Down
4 changes: 2 additions & 2 deletions components/Tabs/tests/unit/TabBarView/MDCTabBarViewTests.m
Expand Up @@ -653,7 +653,7 @@ - (void)testSizeThatFitsExpandsToFitContent {
XCTAssertEqualWithAccuracy(size.height, kMinHeight, 0.001);
}

- (void)testSizeThatFitsDoesntShrinkToFitContent {
- (void)testSizeThatFitsShrinksToFitContentVerticallyButNotHorizontally {
// Given
self.tabBarView.items = @[ self.itemA ];
CGSize intrinsicSize = self.tabBarView.intrinsicContentSize;
Expand All @@ -664,7 +664,7 @@ - (void)testSizeThatFitsDoesntShrinkToFitContent {

// Then
XCTAssertEqualWithAccuracy(size.width, biggerSize.width, 0.001);
XCTAssertEqualWithAccuracy(size.height, biggerSize.height, 0.001);
XCTAssertEqualWithAccuracy(size.height, intrinsicSize.height, 0.001);
}

@end