-
Notifications
You must be signed in to change notification settings - Fork 165
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
Add support for scrollToTransition
prop
#28
base: master
Are you sure you want to change the base?
Conversation
Used in combination with `scrollToIndex`, if passed this prop adds a transition when `scrollToIndex` changes. Use the same syntax as the CSS `transition` property. Do not specify a property. Example transitions: `200ms ease`, `1s cubic-bezier(0.4, 0.0, 0.2, 1)`
…sition` prop is passed
…nerNode for consistency
I have to mention that due to time constraints I didn't write tests for this feature or test it on other use cases than our horizontal timeline (i.e. a vertical list). If you think this change is worth offering to the users of this project, let me know. I'd appreciate your help testing it and I might be able to dedicate some time to it too if necessary. |
There is also a race condition caused by triggering multiple |
…scrollToIndex` changes at the same time
Added a basic fix on this. Any better ideas on how it could be fixed? In general this PR might need some more work. Another issue is that due to instancing/deinstancing of items that are out of view, when the transition starts it'll look like the list is empty, and you won't see any items other than the ones you'd see at the end of the animation. Again, I'm first of all interested in hearing if this feature is worthwhile , but I could help with these improvements if so. |
A solution to this particular issue would be to render the visible ranges around the start and target items, plus the items in-between during the transition. |
@clauderic any opinions on this? |
@clauderic any thoughts? We may soon be able to help bring this a little bit further if there's interest (we'll still need this feature so we may end up having to use a fork of this project) |
Would love to see this merged into master as well. Awesome job @gabrielecirulli . Will have to use a fork as well. |
Any update on this? Would be a feature i'd definitely use! |
As outlined in #27, we're working on an interactive timeline. It would benefit from being able to animate when the user clicks on it and the
scrollToIndex
prop changes.This adds a prop called
scrollToTransition
which, when passed, uses the FLIP Technique to perform a high-performance transition between the original position and the one after the new scroll position is set. The result is a change that's much easier for the user to understand as, rather than jumping, the list animates between two locations.The prop uses the usual CSS transition syntax, but requires that you leave out the name of the property, which is then forced to
transform
.Issues:
scrollToIndex
prop changes at the same timetransition
style)reset
function?)