Skip to content

Transition hooks #1175

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

Closed
wants to merge 7 commits into from
Closed

Transition hooks #1175

wants to merge 7 commits into from

Conversation

underfin
Copy link
Member

@underfin underfin commented May 13, 2020

Bug Fix

  1. Should call appear hook when have a appear props, and add appear hooks props into BaseTransitionProps.
    2.Should call onLeaveCancelled and onEnterCancelled hook.

Feature

  1. It is not correct context which call hook in BaseTransition. because it will throw error with wrapped function in Transition.It is should happend in user provider hooks.

onLeaveCancelled(el) {
finishLeave(el)
callHook(onLeaveCancelled, [el])
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is fix the bug wihch never called onEnterCancelled and onLeaveCancelled hooks

onEnter,
onBeforeEnter,
onEnterCancelled
] = originEnterHook
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Here is fix bug which never called the related appear hooks

export type TransitionOtherHook<HostElement = RendererElement> = (
el: HostElement
) => void

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 think it's helpful for re-use type.But i'm not sure your opinion

@yyx990803
Copy link
Member

Does #1151 contain tests for this?

@underfin
Copy link
Member Author

Does #1151 contain tests for this?

No.The #1151 test is written with master code.I add fixme comment.
You can look at #1151 first.If that no problem, I will update and change test with this pr.

@yyx990803
Copy link
Member

#1151 has been merged - can you rebase on top of master and add appropriate tests? (Note I moved Transition.spec.ts into vue/__tests__

@yyx990803
Copy link
Member

This helped me understand some of the fixme cases in the tests - however the way appear hooks are being handled should've been done inside BaseTransition.

See acd3156 & 7ae70ea

@yyx990803 yyx990803 closed this Jun 25, 2020
@underfin underfin deleted the transition-hooks branch June 26, 2020 01:39
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.

2 participants