Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Upon tab reapearing selection is not taken into account #1777

Closed
YonatanKra opened this issue Mar 4, 2015 · 1 comment
Closed

Upon tab reapearing selection is not taken into account #1777

YonatanKra opened this issue Mar 4, 2015 · 1 comment
Assignees
Milestone

Comments

@YonatanKra
Copy link

First of all, I never mentioned how I LOVE this angular-material project.
Here's the codepen example:
http://codepen.io/yccteam/pen/GgGbzO
The issue is this:

  1. Tabs are created and work fine.
  2. When I click on "Change IF" the tabs are supposed to disappear due to ng-if - works great.
    The problem is:
  3. When "Change IF" is clicked again, the `ng-ifis satisfied and shows the tabs again. butmd-select`` isn't taken into account once the tabs reappear.

I've also added the "ng-show" for sports (just click "Change SHOW" to play with it).
It works, but now I need to take care of the md-bar, which is external to the tab itself.

I currently sove this using a hack with a watcher that sorts things out, but using a watcher while I already have a watcher (ng-if) seems very... hackish...

Is this behavior intentional? Any way to solve this within the API?

Added later:
I've added another functionality that recreates a bug in the tabs:

  1. Click on the "Change SHOW" in order to make the tabs to disappear.
  2. Then click on the "Change Tab" until the tab index changes (the number below the button)
  3. Click on "Change SHOW" in order to make the tabs reappear.
  4. Note the tabs appear wrong
@tic2000
Copy link

tic2000 commented Mar 5, 2015

Hello,

I'm not any expert, but...

Regarding your first issue. The index md-selected is taken into account. The problem is that when you remove the tabs from the dom (which is what ng-if does) that index is set to -1, which you can clearly see in your output.

To fix that without a watch you can assign a function to the click instead of doing a x assignation. In that function you store the index before you change the value of x. Here is a codepen to see what I'm talking about.

Regarding the second issue. First and foremost I see an error when the index is changed while the tabs are hidden. I changed the line 191 of paginationDirective.js to

          currentPage = currentPage || {};
          currentPage.lastTabIndex = index;
          currentPage.tabs = currentPage.tabs || [];

which fixes the error.
Another issue there is that the tab width is not calculated correctly when the tabs are shown again, but I leave that to people which understand this better then me.

A fix would be to set the width in the css with !important. But that only if you don't need a fluid layout.

@ThomasBurleson ThomasBurleson modified the milestone: 0.9.0 Mar 11, 2015
@robertmesserle robertmesserle self-assigned this Mar 12, 2015
robertmesserle added a commit that referenced this issue Mar 19, 2015
Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1626
Closes #1698
Closes #1777
Closes #1850
robertmesserle added a commit that referenced this issue Mar 19, 2015
Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1850
robertmesserle added a commit that referenced this issue Mar 19, 2015
Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1850
robertmesserle added a commit that referenced this issue Mar 20, 2015
Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
robertmesserle added a commit that referenced this issue Mar 20, 2015
Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
Closes #1986
robertmesserle added a commit that referenced this issue Mar 24, 2015
BREAKING CHANGE: Generated HTML structure has changed, so custom styles
will need to be updated to match the new HTML structure.

Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
Closes #1986
robertmesserle added a commit that referenced this issue Mar 24, 2015
BREAKING CHANGE: Generated HTML structure has changed, so custom styles
will need to be updated to match the new HTML structure.

Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
Closes #1986
robertmesserle added a commit that referenced this issue Mar 25, 2015
BREAKING CHANGE: Generated HTML structure has changed, so custom styles
will need to be updated to match the new HTML structure.

Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
Closes #1986
robertmesserle added a commit that referenced this issue Mar 25, 2015
BREAKING CHANGE: Generated HTML structure has changed, so custom styles
will need to be updated to match the new HTML structure.

Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
Closes #1986
Closes #2020
robertmesserle added a commit that referenced this issue Mar 26, 2015
BREAKING CHANGE: Generated HTML structure has changed, so custom styles
will need to be updated to match the new HTML structure.

Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
Closes #1986
Closes #2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants