Skip to content

fix(material-experimental/mdc-chips): decouple removal from animation #21586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2021

Conversation

crisbeto
Copy link
Member

Currently the MDC chips automatically trigger an animation that collapses the chip to 0x0 dimensions, but it still keeps it in the DOM unless the consumer updates their data source. This is misleading and there's no way for the consumer to see it.

These changes bring the chip in line with our current behavior where we only dispatch the remove event and then it's up to the consumer to remove the chip.

Making these changes also revealed some tests that were passing by accident and weren't actually testing the things they were supposed to, because the animationend event wasn't being dispatched. I've tweaked them in order to get them to work as expected.

Fixes #21561.

Currently the MDC chips automatically trigger an animation that collapses the chip to 0x0
dimensions, but it still keeps it in the DOM unless the consumer updates their data source.
This is misleading and there's no way for the consumer to see it.

These changes bring the chip in line with our current behavior where we only dispatch the
remove event and then it's up to the consumer to remove the chip.

Making these changes also revealed some tests that were passing by accident and weren't
actually testing the things they were supposed to, because the `animationend` event wasn't
being dispatched. I've tweaked them in order to get them to work as expected.

Fixes angular#21561.
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 14, 2021
@crisbeto crisbeto marked this pull request as ready for review January 14, 2021 17:12
@crisbeto crisbeto requested a review from mmalerba as a code owner January 14, 2021 17:12
@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release labels Jan 14, 2021
Copy link
Contributor

@andrewseguin andrewseguin left a comment

Choose a reason for hiding this comment

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

LGTM - you're awesome @crisbeto, thanks for making this change

@andrewseguin andrewseguin added the action: merge The PR is ready for merge by the caretaker label Jan 14, 2021
@mmalerba mmalerba added target: rc This PR is targeted for the next release-candidate and removed target: patch This PR is targeted for the next patch release labels Jan 19, 2021
@mmalerba mmalerba merged commit 2d66ecb into angular:master Jan 19, 2021
mmalerba pushed a commit that referenced this pull request Jan 19, 2021
…#21586)

Currently the MDC chips automatically trigger an animation that collapses the chip to 0x0
dimensions, but it still keeps it in the DOM unless the consumer updates their data source.
This is misleading and there's no way for the consumer to see it.

These changes bring the chip in line with our current behavior where we only dispatch the
remove event and then it's up to the consumer to remove the chip.

Making these changes also revealed some tests that were passing by accident and weren't
actually testing the things they were supposed to, because the `animationend` event wasn't
being dispatched. I've tweaked them in order to get them to work as expected.

Fixes #21561.

(cherry picked from commit 2d66ecb)
@mmalerba
Copy link
Contributor

It looks like I ran the presubmit for this when a bunch of internal tests were broken. That caused it to skip all of the broken tests and made it appear that this was safe to merge. However, now that the tests are fixed, it appears this actually breaks a number of tests so I'll need to revert it for now.

mmalerba added a commit that referenced this pull request Jan 20, 2021
mmalerba added a commit that referenced this pull request Jan 20, 2021
mmalerba added a commit that referenced this pull request Jan 20, 2021
…nimation (#21586)" (#21634)

This reverts commit 2d66ecb.

(cherry picked from commit 8172d06)
mmalerba added a commit that referenced this pull request Jan 20, 2021
wagnermaciel pushed a commit to wagnermaciel/components that referenced this pull request Jan 20, 2021
…angular#21586)

Currently the MDC chips automatically trigger an animation that collapses the chip to 0x0
dimensions, but it still keeps it in the DOM unless the consumer updates their data source.
This is misleading and there's no way for the consumer to see it.

These changes bring the chip in line with our current behavior where we only dispatch the
remove event and then it's up to the consumer to remove the chip.

Making these changes also revealed some tests that were passing by accident and weren't
actually testing the things they were supposed to, because the `animationend` event wasn't
being dispatched. I've tweaked them in order to get them to work as expected.

Fixes angular#21561.
wagnermaciel pushed a commit to wagnermaciel/components that referenced this pull request Jan 20, 2021
@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 Feb 20, 2021
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 cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround target: rc This PR is targeted for the next release-candidate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(mdc-chips): matChipRemove should not hide the chip
3 participants