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

Delay and trail conflict on useTransition (v9.0.0-rc3) #1099

Closed
leinelissen opened this issue Jul 30, 2020 · 3 comments · Fixed by #1496
Closed

Delay and trail conflict on useTransition (v9.0.0-rc3) #1099

leinelissen opened this issue Jul 30, 2020 · 3 comments · Fixed by #1496
Assignees
Labels
kind: bug Something isn't working
Milestone

Comments

@leinelissen
Copy link

Hi there! I ran into an issue while creating a multi-stage transition using react-spring.

🐛 Bug Report

As soon as a delay is placed as a property somewhere in the transition, any trail is immediately disregarded.

To Reproduce

See this CodeSandbox: https://codesandbox.io/s/dank-leftpad-hyvle?file=/src/App.js
If a delay is present on any of from, enter or leave, any value of trail is disregarded. As soon as all mentions of delay are removed, the trail shows up as normal.

Expected behavior

I would expect that a delay and trail could be combined, where a delay precedes the staggered set of items following the trail. The typescript annotations show that both trail and delay can be part of the global config, as well as the individual stages, so I figured this should have been a valid combination. If it is not, that is okay too.

Link to repro (highly encouraged)

https://codesandbox.io/s/dank-leftpad-hyvle?file=/src/App.js

Environment

  • react-spring v9.0.0-rc3
  • react v16.12.0

Thanks for making something awesome!

@joshuaellis joshuaellis added template: bug This issue might be a bug v9 labels Mar 18, 2021
@joshuaellis joshuaellis added this to the v9.1.0 milestone Mar 18, 2021
@joshuaellis joshuaellis modified the milestones: v9.1.0, v9.2.0 Apr 8, 2021
@joshuaellis joshuaellis added kind: bug Something isn't working and removed template: bug This issue might be a bug labels May 9, 2021
@joshuaellis joshuaellis self-assigned this May 9, 2021
@joshuaellis
Copy link
Member

So after a bit of initial investigation, I can see we're creating our trail here:

but how delay is handled is the the animation is paused:

delay = callProp(props.delay || 0, key)

So I can only assume that the trailing time calc think it'll only start a trail at time 0, when in this case it could start at time x.
It could be as simple as adding props.delay in useTransition or a bit more than that. But I thought i'd write my initial thoughts here as a record (so I don't forget myself).

@joshuaellis
Copy link
Member

So there also seems to be a bit of confusion, we currently don't allow delay or trail to be in the phase styles object, e.g. enter. So currently you can't have different trails and delays for entering a leaving. It could be an enhancement we add, but I haven't heard of a valid use-case for it yet...

@joshuaellis
Copy link
Member

This has been released on v9.2.0-beta.4

cameron-martin pushed a commit to cameron-martin/react-spring that referenced this issue May 10, 2022
…on (pmndrs#1099)

* Exclude null and undefined in log scale validation

* Fixed formatting

Co-authored-by: Thomas Flanitzer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants