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-select): Mark for check when number of tabs change #1408

Merged
merged 1 commit into from
Jun 29, 2019

Conversation

andrelaszlo
Copy link
Contributor

I discussed this super briefly with @emoralesb05 over email today.

When a td-tab-option is added to a td-tab-select component, the new tabs are sometimes not rendered.

I don't think the error is on my side - I have reproduced it in a simple repo on Stackblitz, that shows a very simple example of adding tabs programmatically can trigger this behavior. This example works well with mat-tab-group as well.

Unfortunately, I haven't found a good way to write a failing test for this bug since change detection works differently while testing. If you have an idea for a good test, please let me know and I'll add it!

My current understanding is that since the component is using OnPush, change detection doesn't work when changes happen inside the ContentChildren observable. Either way, the fix is straightforward and seems to work. Unless you add/remove tabs like crazy, I don't think that it should trigger many extra change detections so the performance impact should be minimal.

@emoralesb05
Copy link
Contributor

Awesome, thanks for this!

@emoralesb05 emoralesb05 merged commit 430088b into Teradata:develop Jun 29, 2019
kriswinbush pushed a commit to kriswinbush/covalent that referenced this pull request Feb 20, 2020
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.

None yet

2 participants