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

Adding (ngClass) classes is different in beta.11 + Angular 4.4.3 #7257

Closed
julianobrasil opened this issue Sep 22, 2017 · 8 comments
Closed
Labels
cannot reproduce The team is unable to reproduce this issue with the information provided

Comments

@julianobrasil
Copy link
Contributor

julianobrasil commented Sep 22, 2017

Bug, feature request, or proposal:

Bug? After upgrade both angular to 4.4.3 and Material to beta.11, [ngClass] started to replace the classes of material components instead of add one more to the list of classes.

What is the expected behavior?

In previous versions, if you used ngClass in a Material Component, it would add the desired class to Material classes.

What is the current behavior?

It is replacing the classes now. Not sure if this was a change in Material or in Angular. I had to change, for example:

In:

<mat-option [ngClass]="myClass"></mat-option>

where I had:

myClass = 'my-class'

now I had to do something like:

myClass = { 
    'my-class': true,
    'mat-option': true
} 

// or myClass = 'my-class mat-option';

What are the steps to reproduce?

Just upgrade to Material beta-11 + Angular 4.4.3

@julianobrasil julianobrasil changed the title bug(mat-select): style broken in beta.11 ngClass different in beta.11 + Angular 4.4.3 Sep 22, 2017
@julianobrasil julianobrasil changed the title ngClass different in beta.11 + Angular 4.4.3 Adding classes is different in beta.11 + Angular 4.4.3 Sep 22, 2017
@willshowell
Copy link
Contributor

I wasn't able to reproduce with md-select/md-option

https://plnkr.co/edit/EwR4JK5J0ZFJCWnG4T4a?p=preview

@jelbourn
Copy link
Member

I wasn't able to reproduce either. @julianobrasil do you have a more specific reproduction?

@jelbourn jelbourn added the cannot reproduce The team is unable to reproduce this issue with the information provided label Sep 22, 2017
@julianobrasil
Copy link
Contributor Author

julianobrasil commented Sep 22, 2017

I'm not near a computer right now. I'm going to close this one and reopen it when I have a working plunk or something to show it. But I had to change this in a project after the last upgrade

@robisim74
Copy link

@julianobrasil are you using flex-layout nightly build? It does not seem to be just a material problem, but a material + flex layout: angular/flex-layout#428

@julianobrasil
Copy link
Contributor Author

@robisim74, yep... I'm using flex-layout nightly build. I'll try to add it in my reproduction plunk.

@naveedahmed1
Copy link

Yes I can confirm its an issue with the latest nightly build of flex-layout. Material beta.11 + Angular 4.4.3 works perfectly with flex-Layout last beta (2.0.0-beta.9).

@julianobrasil
Copy link
Contributor Author

julianobrasil commented Sep 25, 2017

@naveedahmed1, as you've opened an issue in flex-layout repo and it looks like the problem is over there, I'll keep this one closed over here.

@julianobrasil julianobrasil changed the title Adding classes is different in beta.11 + Angular 4.4.3 Adding (ngClass) classes is different in beta.11 + Angular 4.4.3 Sep 25, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cannot reproduce The team is unable to reproduce this issue with the information provided
Projects
None yet
Development

No branches or pull requests

5 participants