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(runtime-dom): skip set transitionProperty if has no cachedTransition #2714

Closed
wants to merge 1 commit into from

Conversation

edison1105
Copy link
Member

close #2712

@@ -163,9 +163,13 @@ export function resolveTransitionProps(
// the transition starts. This is applied for enter transition as well
// so that it accounts for `visibility: hidden` cases.
const cachedTransition = (el as HTMLElement).style.transitionProperty
;(el as HTMLElement).style.transitionProperty = 'none'
if (cachedTransition) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This way will reopen #2593, maybe a better way is needed to fixed both of issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

After add this code:

;(el as HTMLElement).style.transitionProperty = 'none'

hasCSSTransform will be false
https://github.com/vuejs/vue-next/blob/d067fb2dbb82d9a653308baec40bb7f42322b705/packages/runtime-dom/src/components/TransitionGroup.ts#L60-L68

beacuse hasTransform will be false
https://github.com/vuejs/vue-next/blob/d067fb2dbb82d9a653308baec40bb7f42322b705/packages/runtime-dom/src/components/Transition.ts#L344-L346

if change the RegEx to:

/\b(transform|all|none)(,|$)/.test(styles[TRANSITION + 'Property']) 

will works fine.but this is bad solution.
I didn't figure out a better solution yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm also trying to find a new solution.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure, but maybe a more acceptable solution #2716

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure, but maybe a more acceptable solution #2716

Looks better.I will close this PR.

@edison1105 edison1105 closed this Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FLIP Animation not applied when first item spliced
2 participants