Skip to content
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

fix(animations): animateChild shouldn't trigger animation on disabled element #37724

Closed
wants to merge 1 commit into from

Conversation

Zuckjet
Copy link
Contributor

@Zuckjet Zuckjet commented Jun 25, 2020

…ations

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Fixes 35558

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

Zuckjet added a commit to Zuckjet/angular that referenced this pull request Jun 25, 2020
Currently child animation will be triggered by `animateChild()` despite it has been disabled.
These changes add some logic to prevent that unexpected behavior.

PR Close angular#37724
Zuckjet added a commit to Zuckjet/angular that referenced this pull request Jun 25, 2020
Currently child animation will be triggered by `animateChild()` despite it has been disabled.
These changes add some logic to prevent that unexpected behavior.

PR Close angular#37724
@Zuckjet
Copy link
Contributor Author

Zuckjet commented Jun 25, 2020

By the way , the test file has some typo errors before. And I fix it with this PR together.

@Zuckjet Zuckjet changed the title fix(animations): animateChild should not invoke disabled child anim… fix(animations): animateChild shouldn't trigger animation on disabled element Jun 25, 2020
@ngbot ngbot bot added this to the needsTriage milestone Jun 25, 2020
Zuckjet added a commit to Zuckjet/angular that referenced this pull request Jun 26, 2020
Currently child animation will be triggered by `animateChild()` despite it has been disabled.
These changes add some logic to prevent that unexpected behavior.

PR Close angular#37724
@pullapprove pullapprove bot requested a review from mhevery June 26, 2020 04:34
Zuckjet added a commit to Zuckjet/angular that referenced this pull request Jun 26, 2020
Currently child animation will be triggered by `animateChild()` despite it has been disabled.
These changes add some logic to prevent that unexpected behavior.

PR Close angular#37724
Zuckjet added a commit to Zuckjet/angular that referenced this pull request Jun 26, 2020
Currently child animation will be triggered by `animateChild()` despite it has been disabled.
These changes add some logic to prevent that unexpected behavior.

PR Close angular#37724
Zuckjet added a commit to Zuckjet/angular that referenced this pull request Jun 26, 2020
Currently child animation will be triggered by `animateChild()` despite it has been disabled.
These changes add some logic to prevent that unexpected behavior.

PR Close angular#37724
Zuckjet added a commit to Zuckjet/angular that referenced this pull request Jun 26, 2020
Currently child animation will be triggered by `animateChild()` despite it has been disabled.
These changes add some logic to prevent that unexpected behavior.

PR Close angular#37724
Zuckjet added a commit to Zuckjet/angular that referenced this pull request Jun 26, 2020
Currently child animation will be triggered by `animateChild()` despite it has been disabled.
These changes add some logic to prevent that unexpected behavior.

PR Close angular#37724
@pullapprove pullapprove bot removed the request for review from matsko August 27, 2020 14:35
@Zuckjet
Copy link
Contributor Author

Zuckjet commented Jun 15, 2021

The cr/circleci error seems is not relevant with this PR.
It has passed almost one year since first commit, and I am glad to help If there is something I can do to help this PR go on.

@jessicajaniuk
Copy link
Contributor

I've restarted the CI target and am running a google3 presubmit.

@@ -1033,7 +1033,10 @@ export class TransitionAnimationEngine {
// instead stretch the first keyframe gap up until the animation starts. The
// reason this is important is to prevent extra initialization styles from being
// required by the user in the animation.
instruction.timelines.forEach(tl => tl.stretchStartingKeyframe = true);
instruction.timelines = instruction.timelines.filter(tl => {
Copy link
Member

Choose a reason for hiding this comment

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

Overall the changes look good, but this filter with a side effect looks weird since filter predicate functions are supposed to be pure. I'd recommend doing this instead:

const timelines = [];

instruction.timelines.forEach(tl => {
  tl.stretchStartingKeyframe = true;

  if (!this.disabledNodes.has(tl.element)) {
    timelines.push(tl);
  }
});

instruction.timelines = timelines;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, have updated code

Zuckjet added a commit to Zuckjet/angular that referenced this pull request Jun 16, 2021
Currently child animation will be triggered by `animateChild()` despite it has been disabled.
These changes add some logic to prevent that unexpected behavior.

PR Close angular#37724
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

@Zuckjet
Copy link
Contributor Author

Zuckjet commented Jul 1, 2021

friendly ping @IgorMinar

@jessicajaniuk jessicajaniuk removed the request for review from IgorMinar December 13, 2021 18:58
@jessicajaniuk
Copy link
Contributor

@Zuckjet Looks like there's a code conflict here. Can you rebase this? I think we should be able to land it. Once you rebase, I'll re-run a presubmit and we should be green.

@ngbot ngbot bot modified the milestones: needsTriage, Backlog Dec 13, 2021
@jessicajaniuk jessicajaniuk added the risky Identifies a PR that has a level of risk to merging label Dec 13, 2021
Zuckjet added a commit to Zuckjet/angular that referenced this pull request Dec 14, 2021
Currently child animation will be triggered by `animateChild()` despite it has been disabled.
These changes add some logic to prevent that unexpected behavior.

PR Close angular#37724
Currently child animation will be triggered by `animateChild()` despite it has been disabled.
These changes add some logic to prevent that unexpected behavior.

PR Close angular#37724
@Zuckjet
Copy link
Contributor Author

Zuckjet commented Dec 14, 2021

@Zuckjet Looks like there's a code conflict here. Can you rebase this? I think we should be able to land it. Once you rebase, I'll re-run a presubmit and we should be green.

have fixed the conflict.

@jessicajaniuk jessicajaniuk added action: merge The PR is ready for merge by the caretaker and removed state: blocked labels Dec 14, 2021
@jessicajaniuk
Copy link
Contributor

Everything looks good. Thanks @Zuckjet!

@alxhub
Copy link
Member

alxhub commented Dec 14, 2021

This PR was merged into the repository by commit bab7ed3.

alxhub pushed a commit that referenced this pull request Dec 14, 2021
Currently child animation will be triggered by `animateChild()` despite it has been disabled.
These changes add some logic to prevent that unexpected behavior.

PR Close #37724

PR Close #37724
@alxhub alxhub closed this in bab7ed3 Dec 14, 2021
dimakuba pushed a commit to dimakuba/angular that referenced this pull request Dec 28, 2021
…#37724)

Currently child animation will be triggered by `animateChild()` despite it has been disabled.
These changes add some logic to prevent that unexpected behavior.

PR Close angular#37724

PR Close angular#37724
@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 Jan 14, 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 area: animations cla: yes risky Identifies a PR that has a level of risk to merging target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

animateChild invoke disabled child animation in group
8 participants