Skip to content

bug(matRipple): Ripple effect sometimes persists when used with cdkDrag #29159

@gkrzysztofbury

Description

@gkrzysztofbury

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

No response

Description

When setting up cdkDrag with multiple cdkDropList components, initiating a drag very quickly can cause the ripple effect to remain frozen on the component.

Reproduction

Expected Behavior

After the drag ends, the ripple effect should be removed from the button.

Actual Behavior

The ripple effect remains on the button indefinitely.

Cause:

When the drag starts, the original button is removed from the DOM, and a placeholder is created in its place. Immediately after creation, the ripple state is set to RippleState.FADING_IN (source). However, the actual FADING_IN transition does not occur because the button is removed from the DOM.

Proposed Solution:

Modify the code at line 184 to set the state to RippleState.VISIBLE, and then set it to RippleState.FADING_IN on the transitionstart event. This way, the ripple will be removed here:
Remove Ripple

Environment

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

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functionsarea: material/core

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions