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

fix(tab-bar): Early exit #3386

Merged
merged 3 commits into from
Aug 22, 2018
Merged

fix(tab-bar): Early exit #3386

merged 3 commits into from
Aug 22, 2018

Conversation

bonniezhou
Copy link
Contributor

Move the early exit for activating a tab from Tab to TabBar.

Adapter methods may be asynchronous in other frameworks, resulting in a race condition when deactivateTabAtIndex and activateTabAtIndex are called synchronously in MDCTabBarFoundation.activateTab.

@mdc-web-bot
Copy link
Collaborator

All 353 screenshot tests passed for commit 7d388b2 vs. master! 💯🎉

@codecov-io
Copy link

codecov-io commented Aug 20, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@3fec896). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3386   +/-   ##
=========================================
  Coverage          ?   98.45%           
=========================================
  Files             ?      123           
  Lines             ?     5182           
  Branches          ?      638           
=========================================
  Hits              ?     5102           
  Misses            ?       80           
  Partials          ?        0
Impacted Files Coverage Δ
packages/mdc-tab/foundation.js 100% <ø> (ø)
packages/mdc-tab-bar/foundation.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fec896...fd1ea75. Read the comment docs.

@@ -92,11 +92,6 @@ class MDCTabFoundation extends MDCFoundation {
* @param {!ClientRect=} previousIndicatorClientRect
*/
activate(previousIndicatorClientRect) {
// Early exit
if (this.isActive()) {
Copy link
Contributor

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?

Copy link
Contributor Author

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)

Copy link
Contributor

@patrickrodee patrickrodee left a comment

Choose a reason for hiding this comment

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

👏

@mdc-web-bot
Copy link
Collaborator

All 353 screenshot tests passed for commit fd1ea75 vs. master! 💯🎉

@bonniezhou bonniezhou merged commit f0ebfea into master Aug 22, 2018
@bonniezhou bonniezhou deleted the fix/tab-bar/early-exit branch September 14, 2018 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants