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

Consider adding animation timeouts #10

Open
mr-mig opened this issue Nov 21, 2016 · 5 comments
Open

Consider adding animation timeouts #10

mr-mig opened this issue Nov 21, 2016 · 5 comments

Comments

@mr-mig
Copy link

mr-mig commented Nov 21, 2016

ReactCSSTransitionGroup as well as some other components (e.g. React Overlays Transition have a timeout prop for handling the cases when transitionEnd or animationEnd events are interrupted.
I think it will be beneficial for this component as well.

@arve0
Copy link
Owner

arve0 commented Nov 23, 2016

Sounds sensible. Some questions:

  1. Do you think the animation class should be removed on the timeout?
  2. In which cases are animations interrupted?
  3. Which difficulties does an interrupted animation give?

@mr-mig
Copy link
Author

mr-mig commented Nov 24, 2016

  1. In which cases are animations interrupted?

According to Overlays Transition docs:

A Timeout for the animation, in milliseconds, to ensure that a node doesn't transition indefinately if the browser transitionEnd events are canceled or interrupted.

transitionEnd may be interrupted:

In the case where a transition is removed before completion, such as if the transition-property is removed, then the event will not fire.

animationEnd is not cancellable (per spec), but the animation may be interrupted:

Once an animation has started it continues until it ends or the ‘animation-name’ is removed

Or another possibility:

Setting the display property to ‘none’ will terminate any running animation applied to the element and its descendants

  1. Which difficulties does an interrupted animation give?

If the animation is interrupted, then the "animation end hook" is not reliable and may break any logic associated with the hook (e.g. node remove will never happen, and the user will always see the element stuck in a mid of animation)

@mr-mig
Copy link
Author

mr-mig commented Nov 24, 2016

  1. Do you think the animation class should be removed on the timeout?

Ideally, yes. If the timeout is specified less than animation-duration in css, it will forcibly stop the animation (which, IMO, is a desired effect in any case of timeout !== animation-duration)

@arve0
Copy link
Owner

arve0 commented Dec 4, 2016

Sorry about the late reply.

Would also checking animation-duration as a default for timeout make sense?

@mr-mig
Copy link
Author

mr-mig commented Dec 14, 2016

@arve0 I think it may be a reason to log a Warning

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

No branches or pull requests

2 participants