Components: Disable ripple for checkbox

Created on 15 Oct 2019  路  4Comments  路  Source: angular/components

Reproduction

Steps to reproduce:

  1. GoTo a modified example from the docs: https://stackblitz.com/edit/angular-wqcqyp
  2. {provide: MAT_RIPPLE_GLOBAL_OPTIONS, useValue: { disabled: true }} inside main.ts
  3. mat-checkbox [disableRipple]="true" in checkbox-configurable-example.html

Expected Behavior

IT should not be visible but after updating to angular 8 and Angular material latest version the ripple is visible again even if disableRipple is used, so I added the global disable ripple configuration but still the same

Actual Behavior

The ripple on the checkbox on hover is visible although disableRipple and MAT_RIPPLE_GLOBAL_OPTIONS disabled is specified

Environment

  • Angular: 8
  • CDK/Material: 8.2.4 (same issue with 8.1.4)
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOs
materiacheckbox

Most helpful comment

Could be connected to:
https://github.com/angular/components/issues/16100

Just add
<mat-checkbox>Checked 1</mat-checkbox>

to the app.component in the source code of the named issue and you will see that it still has 'hover' effect, It's a regression after i updated from angular material 6, but it could be that I disabled it trough CSS.

Workaround fix would be:
.mat-ripple { display: none; }

or .mat-checkbox-ripple only for checkbox

All 4 comments

Could be connected to:
https://github.com/angular/components/issues/16100

Just add
<mat-checkbox>Checked 1</mat-checkbox>

to the app.component in the source code of the named issue and you will see that it still has 'hover' effect, It's a regression after i updated from angular material 6, but it could be that I disabled it trough CSS.

Workaround fix would be:
.mat-ripple { display: none; }

or .mat-checkbox-ripple only for checkbox

The ripples only refer to the ones that are shown on clicks. It doesn't affect the one that show up in hover or focus, because they're there for accessibility.

Closing since this is working as expected.

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._

Was this page helpful?
0 / 5 - 0 ratings