Skip to content

fix(material-experimental): menu item should not inherit parent classname #17953

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

Merged
merged 1 commit into from
Dec 12, 2019

Conversation

andrewseguin
Copy link
Contributor

No description provided.

@andrewseguin andrewseguin added pr: merge safe target: patch This PR is targeted for the next patch release labels Dec 12, 2019
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 12, 2019
@@ -19,6 +19,9 @@ import {MatMenuItem as BaseMatMenuItem} from '@angular/material/menu';
inputs: ['disabled', 'disableRipple'],
host: {
'[attr.role]': 'role',
// The MatMenuItem parent class adds `mat-menu-item` to the CSS classlist, but this should
// not be added for this MDC equivalent menu item.
'[class.mat-menu-item]': 'false',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK Ivy and ViewEngine have different behavior when it comes to resolving conflicting class bindings so I'm not sure how this will behave. Maybe we should just set the class manually in the constructor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a few approaches to doing this but none seem to be the ideal one. I don't particularly have a strong preference over any certain solution, and Jeremy and I just happened to land on this as the simplest. Based on what I see when running the devapp, this works fine

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dev app runs in Ivy, it's ViewEngine that's inconsistent with how it handles conflicting bindings.

Copy link
Contributor Author

@andrewseguin andrewseguin Dec 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably know more than I do with these conflicts, but I don't believe host bindings in the component metadata pass down at all to subclassed components. Do you know how to run the devapp in VE so I can test it out and confirm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good point that inheriting host didn't work on VE. In that case it should be fine. I don't know how we can run the dev app in VE.

Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crisbeto crisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Dec 12, 2019
@andrewseguin andrewseguin merged commit af7aa86 into angular:master Dec 12, 2019
@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 Jan 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants