-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix(tab-bar): Early exit #3386
fix(tab-bar): Early exit #3386
Conversation
All 353 screenshot tests passed for commit 7d388b2 vs. |
Codecov Report
@@ Coverage Diff @@
## master #3386 +/- ##
=========================================
Coverage ? 98.45%
=========================================
Files ? 123
Lines ? 5182
Branches ? 638
=========================================
Hits ? 5102
Misses ? 80
Partials ? 0
Continue to review full report at Codecov.
|
@@ -92,11 +92,6 @@ class MDCTabFoundation extends MDCFoundation { | |||
* @param {!ClientRect=} previousIndicatorClientRect | |||
*/ | |||
activate(previousIndicatorClientRect) { | |||
// Early exit | |||
if (this.isActive()) { |
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.
Does this have any problems if an already active tab is activated again when the tab is outside of the tab bar?
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.
Nope it looks fine, based on the demos page which calls activate
on the tab directly (without a tab bar)
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.
👏
All 353 screenshot tests passed for commit fd1ea75 vs. |
Move the early exit for activating a tab from
Tab
toTabBar
.Adapter methods may be asynchronous in other frameworks, resulting in a race condition when
deactivateTabAtIndex
andactivateTabAtIndex
are called synchronously inMDCTabBarFoundation.activateTab
.