Skip to content

bug(mat-button, mat-checkbox, mat-list-item): Ripple animations don't function correctly with custom theme #27094

@rsdmike

Description

@rsdmike

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

I'm in the process of migrating to Angular v15 along with Material v15 and this is not present in v14.

Description

Seems when using a custom theme, the ripple animations don't behave correctly on any component. Using a pre-built theme, this behavior is not present.

Reproduction

Steps to reproduce:

I've put a simple reproduction here: https://github.com/rsdmike/test-repo

Relevant style:

@use "@angular/material" as mat;

$materialtest-app-typography: mat.define-typography-config();
$materialtest-app-primary: mat.define-palette(mat.$cyan-palette, 700);
$materialtest-app-accent: mat.define-palette(mat.$cyan-palette, 200, A100, A700);
$materialtest-light-app-theme: mat.define-light-theme(
    (
        color: (
            primary: $materialtest-app-primary,
            accent: $materialtest-app-accent,
        ),
        typography: $materialtest-app-typography,
        density: 0,
    )
);
@include mat.all-component-themes($materialtest-light-app-theme);

html,
body,
app-root,
mat-drawer-container,
mat-sidenav-container {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: auto; //font-size: 14px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

and html

<mat-sidenav-container>
  <mat-sidenav mode="side" opened>
    <mat-nav-list>
      <a mat-list-item routerLink="/">
        <mat-icon matListItemIcon>home</mat-icon><span>test</span>
      </a>
      <button mat-flat-button>
          test
      </button>
      <mat-checkbox>test</mat-checkbox>
    </mat-nav-list>
  </mat-sidenav>

  <mat-sidenav-content>

  </mat-sidenav-content>
</mat-sidenav-container>

Expected Behavior

I expect the ripple to animate the same as if I were using a prebuilt theme

Actual Behavior

image

Environment

  • Angular: v15
  • CDK/Material: v15.2.9
  • Browser(s): Edge/Chromium
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions