bug(MatRipple): MatRipple can not be disabled for child components
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
### 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
14
### Description
I once opened this issue (https://github.com/angular/components/issues/26656) and now coming back with another real-world-issue, that can't be solved neatly.
I have a selection with a ripple effect (the boxes in the screenshot) and some, optional, sub-options:

Now every time I hit a suboption the box' ripple effect shows up. Disabling it only on inner click and re-enabling it seams like some nasty timing problem (and even looks like [ripple gets removed on mouse down etc.]).
In my opinion there **really** is a need to be able to disabler the ripple effect for some boxes inside the ripple container. There should either be a directive for disabling it or to make things easy, like I suggested in my previous post, be able to switch from `capture` to `bubbling` so it can be disabled the _vanilla Javascript way_ (`stopPropagation`).
### Reproduction
https://stackblitz.com/edit/angular-phk79p-fyt248
### Expected Behavior
Ripple should not show up on clicking some container's child elements.
### Actual Behavior
Ripple cannot be disabled for some inner clicks.
### Environment
- Angular: 18.0.1
- CDK/Material: 18.0.0
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Reproduisez le comportement des clics imbriqués dans le StackBlitz lié avec Angular 18.0.1 et CDK/Material 18.0.0, puis examinez la gestion des événements de MatRipple. Déterminez comment les éléments enfants pourraient empêcher le ripple du conteneur sans solutions de contournement dépendant du timing. Le travail est considéré comme terminé lorsque les clics sur les éléments enfants désignés ne déclenchent pas le ripple du conteneur, tandis que les clics normaux sur le conteneur continuent de le faire.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100