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

SplitTextWrapper makes new instance when the SplitText is reverted #152

Open
hjeti opened this issue Jun 28, 2023 · 1 comment
Open

SplitTextWrapper makes new instance when the SplitText is reverted #152

hjeti opened this issue Jun 28, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@hjeti
Copy link

hjeti commented Jun 28, 2023

I had a nasty problem with timeline that were breaking. In the end I figured out it was caused by the SplitTextWrapper after one of the text animations the SplitText was reverted. The SplitTextWrapper checks on isSplit and if it's not split then it creates a new SplitText instance on the ref. Problem was that the text animations were exposed. So at the moment that another timeline was exposed in the website it would trigger the callback of the useExposedAnimation. That then returns nothing because the ref was updated and there is no animation linked to that ref in the animation map. This caused that the parent animation would be recreated and break because of missing animations.

I now patched the transition component so that SplitTextWrapper doesn't check on the isSplit property anymore. It should be the responsibility of the developer to split it or revert it. That patch will be tested in the project.

Maybe the isSplit check was added to keep splitting when the children update or something like that. But in my case it was breaking the animations.

@hjeti hjeti added the bug Something isn't working label Jun 28, 2023
@hjeti hjeti changed the title SplitTextWrapper makes new instance when the SplitText is reverted SplitTextWrapper makes new instance when the SplitText is reverted Jun 28, 2023
@leroykorterink
Copy link
Collaborator

@hjeti when a SplitText instance is created it's splits the targets immediately. Was the patch in the project successful? If so, can you create a PR?

Should we remove the isSplit check? That will create a new SplitText instance every time the children change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants