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(menu): Set menu-item icon color only when not set on mat-icon #8614

Merged
merged 6 commits into from
Dec 1, 2017
Merged

fix(menu): Set menu-item icon color only when not set on mat-icon #8614

merged 6 commits into from
Dec 1, 2017

Conversation

glenstaes
Copy link
Contributor

Set the theme icon color only if the color input property was not set on the mat-icon component.

Fixes #8594

Set the theme icon color only if the `color` input property was not set on the `mat-icon` component.

Fixes #8594
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 23, 2017
@glenstaes glenstaes closed this Nov 23, 2017
Add unit tests for setting the mat-icon[color] attribute on a menu item
@glenstaes glenstaes reopened this Nov 23, 2017
@glenstaes glenstaes changed the title fix(menu): Set menu-item icon color if not set on mat-icon fix(menu): Set menu-item icon color only when not set on mat-icon Nov 23, 2017
@@ -223,6 +225,32 @@ describe('MatMenu', () => {
expect(fixture.componentInstance.items.first.getLabel()).toBe('Item');
});

it('should have an icon with the default theme color if mat-icon has no color attribute set',
Copy link
Member

Choose a reason for hiding this comment

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

You can get rid of these tests since they're basically testing the CSS engine.

@@ -44,7 +45,7 @@ describe('MatMenu', () => {
beforeEach(async(() => {
dir = 'ltr';
TestBed.configureTestingModule({
imports: [MatMenuModule, NoopAnimationsModule],
imports: [MatIconModule, MatMenuModule, NoopAnimationsModule],
Copy link
Member

Choose a reason for hiding this comment

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

In general we try to avoid having dependencies between components like this. It shouldn't be an issue after the previous comment about removing the tests is addressed.

@glenstaes
Copy link
Contributor Author

@crisbeto Comments have been addressed

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 and removed pr: needs review labels Nov 29, 2017
@tinayuangao tinayuangao merged commit d0cb077 into angular:master Dec 1, 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
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

<mat-icon> ignores color attribute if inside <button mat-menu-item>
5 participants