Skip to content

fix(material/core): ripples not being removed if container is hidden#26096

Merged
crisbeto merged 1 commit intoangular:mainfrom
crisbeto:ripple-display-none
Nov 28, 2022
Merged

fix(material/core): ripples not being removed if container is hidden#26096
crisbeto merged 1 commit intoangular:mainfrom
crisbeto:ripple-display-none

Conversation

@crisbeto
Copy link
Member

Fixes that the ripples weren't being removed if the ripple container has display: none on it. This is a bit of an edge case that I hit while working on a different task, but it's easy to guard against since we have all the information to know when it happens.

Fixes that the ripples weren't being removed if the ripple container has `display: none` on it. This is a bit of an edge case that I hit while working on a different task, but it's easy to guard against since we have all the information to know when it happens.
@crisbeto crisbeto added P4 A relatively minor issue that is not relevant to core functions target: patch This PR is targeted for the next patch release labels Nov 27, 2022
@crisbeto crisbeto requested a review from devversion as a code owner November 27, 2022 08:44
userTransitionDuration === '0s, 0s';
userTransitionDuration === '0s, 0s' ||
// If the container is 0x0, it's likely `display: none`.
(containerRect.width === 0 && containerRect.height === 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but as said, this logic exists for backwards compatibility. Do we actually want to expand it further, or is there a specific issue we are addressing (internally or externally)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The specific issue is the one I mentioned in the description. It's a bit of an edge case, but I can totally see somebody setting display: none on the ripple container and accidentally causing a memory leak. I sent out the fix since it's pretty cheap for us to guard against it.

Copy link
Member

@devversion devversion Nov 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was intentionally not supporting all cases back when we added this logic, so I don't know if we necessarily would want to do this. At the same time though it feels like a simple addition- but we should be clear that we do not intend to handle all "force disable cases"- also I think this may not be a "fix" since working as intended

@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Nov 28, 2022
@crisbeto crisbeto self-assigned this Nov 28, 2022
@crisbeto crisbeto merged commit 374993f into angular:main Nov 28, 2022
crisbeto added a commit that referenced this pull request Nov 28, 2022
…26096)

Fixes that the ripples weren't being removed if the ripple container has `display: none` on it. This is a bit of an edge case that I hit while working on a different task, but it's easy to guard against since we have all the information to know when it happens.

(cherry picked from commit 374993f)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker P4 A relatively minor issue that is not relevant to core functions target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants