Skip to content

fix(overlay): overlay class audits #6372 #8056

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
Oct 30, 2017

Conversation

amcdnl
Copy link
Contributor

@amcdnl amcdnl commented Oct 26, 2017

Clean cut of #7454 that only changes names

@amcdnl amcdnl self-assigned this Oct 26, 2017
@amcdnl amcdnl requested a review from jelbourn October 26, 2017 19:28
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 26, 2017
@@ -35,7 +35,13 @@ export class MatSnackBarConfig {
duration?: number = 0;

/** Extra CSS classes to be added to the snack bar container. */
extraClasses?: string[];
panelClass?: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

I have two concerns with this,

  1. This adds the class to the snackbar container, not the overlay panel. So it's slightly misleading and inconsistent with dialogs in that regard.

  2. More importantly, I think panelClass implies that a single string would be sufficient. Since string[] is req'd, the snackbar container will convert panelClass: "my-class" to

    <snack-bar-container class="m y - c l a s">...</snack-bar-container>
    

    I think the MatSnackBar#_createOverlay could use the overlay-ref logic to automatically handle this .

I know this PR is trying to only change the names, but I think this name change is misrepresenting unless it's also met with a change in functionality.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed; I didn't realize snackbar was string[] only right now. @amcdnl let's just change this one to string | string[] as well

@@ -167,6 +167,9 @@ export class MatDatepicker<D> implements OnDestroy {
*/
@Output() selectedChanged = new EventEmitter<D>();

/** Classes to be passed to the date picker panel. Supports the same syntax as `ngClass`. */
@Input() panelClass: string|string[]|Set<string>|{[key: string]: any};
Copy link
Member

Choose a reason for hiding this comment

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

I think Set<string>|{[key: string]: any} is a bit overkill. I'd rather stick with string | string[] for the time being.

* @deprecated Use `panelClass` instead.
* @param classes list of class names
*/
@Input() classList = this.panelClass;
Copy link
Member

Choose a reason for hiding this comment

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

This needs a getter/setter that delegates to panelClass; this will only set the initial value

@@ -35,7 +35,13 @@ export class MatSnackBarConfig {
duration?: number = 0;

/** Extra CSS classes to be added to the snack bar container. */
extraClasses?: string[];
panelClass?: string[];
Copy link
Member

Choose a reason for hiding this comment

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

Agreed; I didn't realize snackbar was string[] only right now. @amcdnl let's just change this one to string | string[] as well

* Extra CSS classes to be added to the snack bar container.
* @deprecated Use `panelClass` instead.
*/
extraClasses?: string[] = this.panelClass;
Copy link
Member

Choose a reason for hiding this comment

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

This leaves the option here, but it will still break because it doesn't do anything now; the snack-bar needs to combine both until we remove this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Checkout what I did there, open to suggestions for better ideas.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

* menu template that displays in the overlay container. Otherwise, it's difficult
* to style the containing menu from outside the component.
* @deprecated Use `panelClass` instead.
* @param classes list of class names
Copy link
Member

Choose a reason for hiding this comment

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

Setter doesn't take @param

@jelbourn jelbourn added P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful pr: lgtm action: merge The PR is ready for merge by the caretaker labels Oct 30, 2017
@mmalerba mmalerba merged commit cd05b54 into angular:master Oct 30, 2017
@amcdnl amcdnl deleted the panel-class-6372 branch November 1, 2017 15:42
@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 P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants