Skip to content

Commit

Permalink
refactor(material/snack-bar): use classList.toggle
Browse files Browse the repository at this point in the history
With Angular dropping IE11 support in version 13, we can now use `classList.toggle` with the second `force` param. Related to #7374
  • Loading branch information
jelbourn committed Aug 2, 2021
1 parent 5f906a3 commit b816321
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/material/snack-bar/snack-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ export class MatSnackBar implements OnDestroy {
this._breakpointObserver.observe(Breakpoints.HandsetPortrait).pipe(
takeUntil(overlayRef.detachments())
).subscribe(state => {
const classList = overlayRef.overlayElement.classList;
state.matches ? classList.add(this.handsetCssClass) : classList.remove(this.handsetCssClass);
overlayRef.overlayElement.classList.toggle(this.handsetCssClass, state.matches);
});

if (config.announcementMessage) {
Expand Down

0 comments on commit b816321

Please sign in to comment.