-
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
feat(tab): Add MDCTabDimensions computation method #3122
feat(tab): Add MDCTabDimensions computation method #3122
Conversation
Codecov Report
@@ Coverage Diff @@
## feat/tabs/tabs #3122 +/- ##
==================================================
+ Coverage 98.41% 98.41% +<.01%
==================================================
Files 113 113
Lines 4790 4808 +18
Branches 600 600
==================================================
+ Hits 4714 4732 +18
Misses 76 76
Continue to review full report at Codecov.
|
@@ -127,6 +135,24 @@ class MDCTabFoundation extends MDCFoundation { | |||
computeIndicatorClientRect() { | |||
return this.adapter_.computeIndicatorClientRect(); | |||
} | |||
|
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.
Is there a reason the foundation actually needs this (thus necessitating additions to foundation, adapter, and component), or could it actually just be done entirely at the component level? This is basically just doing straight-up DOM math. I'm not sure I'd even qualify that as "business logic".
In order to animate the Tab Indicator from one tab to another, we need to
know the dimensions of the previous tab indicator. By getting the previous
tab indicator’s dimensions with this method, we’re able to perform a
performant FLIP animation.
…On Wed, Jul 18, 2018 at 7:28 AM Kenneth G. Franqueiro < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In packages/mdc-tab/foundation.js
<#3122 (comment)>
:
> @@ -127,6 +135,24 @@ class MDCTabFoundation extends MDCFoundation {
computeIndicatorClientRect() {
return this.adapter_.computeIndicatorClientRect();
}
+
Is there a reason the foundation actually needs this (thus necessitating
additions to foundation, adapter, and component), or could it actually just
be done entirely at the component level? This is basically just doing
straight-up DOM math. I'm not sure I'd even qualify that as "business
logic".
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3122 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFqhdrFePrhWCKplTV7U_tecbWKafYx5ks5uH0YRgaJpZM4VTyoh>
.
|
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.
Discussed with Pat; leaving in foundation and adapter to attempt to make it less complex to write framework wrappers.
WIP fixed bg coloring of icons fix(tab-indicator): Use absolute positioning (#2547) WIP start of tab scroller WIP fixed transition duration WIP progress on scroller WIP added demos back chore(tabs): Removed tab scroller feat(tabs): Add tab indicator inside tab (#2565) feat(tab-scroller): Add tab scroller (#2577) Merge master into feat/tabs/tabs (#3096) feat(tab): Update tab color and typography (#3108) docs(tabs): Update metadata and synopses (#3117) feat(tab): Add MDCTabDimensions computation (#3122) feat(tab): Emit selection and activation events (#3139) docs(tabs): Update new READMEs to match standard (#3142) feat(tab): Give focus to tab when activated (#3164) feat(tab): Add mixin for parent positioning; Use mixin in tab scroller (#3179) fix(tabs): Suppress area occupied by scrollbar on platforms that show it (#3149) fix(tab): Remove extraneous padding from the stacked text label in LTR (#3193) feat(tabs): Add missing docs and create helper util API (#3194) Merge master into feat/tabs/tabs (#3227) feat(tab): Update layout; Add fixed-width mixin; Add min-width class (#3220) fix(tab-scroller): Fix incorrect animation stopping scroll value in RTL (#3237) feat(tab-scroller): Add scroll content width method for use in tab bar (#3222) feat(tab): Remove activation event emitting (#3242) feat(tab-bar): Add tab bar (#3229)
Add
computeDimensions
method toMDCTab
andMDCTabFoundation
. AddMDCTabDimensions
type to adapter file. AddgetOffsetWidth
,getOffsetLeft
,getContentOffsetWidth
, andgetContentOffsetLeft
toMDCTabAdapter
. Add tests for new adapter, foundation, and component methods. Update readme. Add periods to the end of JSDoc lines with no periods. Closes #3121