fix(animations): retain triggers values for moved tracked list items#44578
Closed
dario-piotrowicz wants to merge 1 commit intoangular:masterfrom
Closed
fix(animations): retain triggers values for moved tracked list items#44578dario-piotrowicz wants to merge 1 commit intoangular:masterfrom
dario-piotrowicz wants to merge 1 commit intoangular:masterfrom
Conversation
when reordering a list with animations the list items lose their current triggers values, that is because the reordering of an item is implemented as follows (_note:_ the following implementation has been added in PR angular#23534) - the item is removed and marked _setForRemoval_ - the item is re-inserted, and the _setForRemoval_ is changed to _setForMove_ - the player set for animating the removal is destroyed when _setForMove_ is detected the above steps allow the element not to be animated and to keep its styling but the triggers values get lost since the removal transition/player has already been initialized, so this change adds a _previousTriggersValues_ map in the _REMOVAL_FLAG_ field in order to restore the triggers values if/when the removal turns out to be a move, changing the above steps to: - the item is removed and marked setForRemoval __and its current triggers values are saved as well__ - the item is re-inserted, and the setForRemoval is changed to setForMove - the player set for animating the removal is destroyed when setForMove is detected __and the trigger values are re-applied in the engine's statesByElement map__ resolves angular#29526
14 tasks
jessicajaniuk
approved these changes
Jan 7, 2022
Contributor
jessicajaniuk
left a comment
There was a problem hiding this comment.
LGTM 🍪
This is probably the only way this issue can be resolved given the constraints. Thanks for looking into this, @dario-piotrowicz!
Contributor
|
This PR was merged into the repository by commit 8ba43a1. |
atscott
pushed a commit
that referenced
this pull request
Jan 7, 2022
…44578) when reordering a list with animations the list items lose their current triggers values, that is because the reordering of an item is implemented as follows (_note:_ the following implementation has been added in PR #23534) - the item is removed and marked _setForRemoval_ - the item is re-inserted, and the _setForRemoval_ is changed to _setForMove_ - the player set for animating the removal is destroyed when _setForMove_ is detected the above steps allow the element not to be animated and to keep its styling but the triggers values get lost since the removal transition/player has already been initialized, so this change adds a _previousTriggersValues_ map in the _REMOVAL_FLAG_ field in order to restore the triggers values if/when the removal turns out to be a move, changing the above steps to: - the item is removed and marked setForRemoval __and its current triggers values are saved as well__ - the item is re-inserted, and the setForRemoval is changed to setForMove - the player set for animating the removal is destroyed when setForMove is detected __and the trigger values are re-applied in the engine's statesByElement map__ resolves #29526 PR Close #44578
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
when reordering a list with animations the list items lose their current
triggers values, that is because the reordering of an item is implemented
as follows (note: the following implementation has been added in PR #23534)
the above steps allow the element not to be animated and to keep its styling but the
triggers values get lost since the removal transition/player has already been initialized,
so this change adds a previousTriggersValues map in the REMOVAL_FLAG field in order to
restore the triggers values if/when the removal turns out to be a move, changing the above steps to:
trigger values are re-applied in the engine's statesByElement map
resolves #29526
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Issue
Issue Number: #29526
Does this PR introduce a breaking change?
@jessicajaniuk 😄