Skip to content

feat(material/autocomplete): add panelClass default option #20429

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 3 commits into from
Sep 1, 2020

Conversation

andrewseguin
Copy link
Contributor

Necessary for implementing the Google Material version internally, which relies on being able to provide options to the autocomplete to automatically apply a Google Material class

@andrewseguin andrewseguin added P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release labels Aug 26, 2020
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 26, 2020
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.

Do the panel classes have to be on the mat-autocomplete-panel specifically or can they be one level up on the cdk-overlay-pane? If it's the latter, then this could be simplified by passing the panelClass value when creating the overlay here: https://github.com/angular/components/blob/master/src/material/autocomplete/autocomplete-trigger.ts#L637

@andrewseguin
Copy link
Contributor Author

Sure - that works too - as long as its a parent class then we're good. I changed it so the options are now injected into the trigger as well and we pass through the panel class

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.

One more nit and it's LGTM on my end.

@@ -2119,6 +2119,39 @@ describe('MatAutocomplete', () => {
}));
});

describe('with panel classes in the default options', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Can you copy these tests into the MDC autocomplete too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah for sure, good call

@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Aug 27, 2020
@mmalerba mmalerba added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Sep 1, 2020
@mmalerba mmalerba merged commit 3c2334c into angular:master Sep 1, 2020
mmalerba pushed a commit to mmalerba/components that referenced this pull request Sep 5, 2020
…0429)

* feat(material/autocomplete): add panelClass default option

* update goldens

* add tests to MDC
@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 Oct 2, 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 P2 The issue is important to a large percentage of users, with a workaround target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants