Skip to content

Commit

Permalink
[MDCPageControl] Fix currentPage being set as -1 in RTL languages.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 574376258
  • Loading branch information
Nobody authored and material-automation committed Oct 18, 2023
1 parent e8770c1 commit 13e691c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/PageControl/src/MDCPageControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ - (NSInteger)scrolledPageNumber:(UIScrollView *)scrollView {
lround(scrollView.contentOffset.x / scrollView.frame.size.width);
NSInteger scrolledPageNumberLTR = MAX(0, MIN(_numberOfPages - 1, unboundedPageNumberLTR));
if ([self isRTL]) {
return self.numberOfPages - 1 - scrolledPageNumberLTR;
return MAX(0, self.numberOfPages - 1 - scrolledPageNumberLTR);
}
return scrolledPageNumberLTR;
}
Expand Down

0 comments on commit 13e691c

Please sign in to comment.