-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(tabs): remove inline css width if tabs should stretch #7157
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
1 similar comment
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
052bc63
to
c7a226b
Compare
CLAs look good, thanks! |
1 similar comment
CLAs look good, thanks! |
c7a226b
to
a1ecb00
Compare
Updated my local git e-mail (was using my .edu) |
a1ecb00
to
aecb821
Compare
@JSMike - Seems like this fix introduces a perf/reflow issue? |
@topherfangio - review ? |
@JSMike I think this would be better if we moved this logic (including the Ideally some comments and a test would be great too. |
Ok I'll take a look. |
33f2b0a
to
f04c358
Compare
I'm not quite sure why tests are failing in the utils test suite, and only when minified. @topherfangio Could you let me know if the changes I made were in line with what you were thinking? |
Just confirmed it was due to my adding $timeout.flush() to the tabs tests to make sure all the init() functions run. I'll see if there's a better way. |
f04c358
to
0264ceb
Compare
I removed the call to $timeout.flush() and instead used a spy on $mdUtil.nextTick to control when the functions were called. I haven't use jasmine much so I'm not sure if this was the most elegant solution, let me know if you'd prefer something else. |
34eb8f5
to
fb383bc
Compare
@JSMike Out of curiosity: did you try adding the Two other notes:
Thanks so much for tackling this! Please let me know if you have any questions or need any guidance, I am happy to help and even do a quick call if needed. |
@topherfangio You're correct with $timeout.flush() inside of the setup causing other tests to fail. The pattern with inject wrapping the entire test function makes sense, I didn't realize that some tests were already doing that and copied one that just used an anon function, that's why I was having issues. I'll look into this some more tonight. Does everything look better in tabsController.js as far as cleaning up the functions? The only other question I have for right now, should I rebase this PR into one commit? |
@JSMike Yes, everything in the If you can squash it into a single commit, that would be great! Thanks again! |
There is an issue when dynamically setting md-stretch-tabs. If shouldStretchTabs() evaluates to false at any time then a fixed width is added and never removed. This fix updates the logic in updatePagingWidth() so that the inline style is always either updated or cleared from `<md-pagination-wrapper>` depending on shoulStretchTabs(). Add tests for md-pagination-wrapper.
fb383bc
to
86297da
Compare
Fixed tests and rebased. Note: I was working on tests to set an initial inline style, update md-stretch-tabs, and confirm inline style change. I was having success in chrome but I couldn't get it to work in phantom so I took them out. |
@ThomasBurleson LGTM |
@JSMike - Kudos! |
There is an issue when dynamically setting md-stretch-tabs. If shouldStretchTabs() evaluates to false at any time then a fixed width is added and never removed. This fix removes a fixed inline width from
<md-pagination-wrapper>
if shoulStretchTabs() returns true.