-
Notifications
You must be signed in to change notification settings - Fork 176
Support delayed stabilisation for simple list #167
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
base: master
Are you sure you want to change the base?
Support delayed stabilisation for simple list #167
Conversation
@@ -113,7 +116,14 @@ module.exports = class ReactList extends Component { | |||
}, 0); | |||
} | |||
|
|||
this.updateFrame(); | |||
if (type === 'simple' && stableFrameDelay) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to restrict this prop to the 'simple'
list type. It seems like it could potentially be used for 'variable'
or 'uniform'
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, based on my interpretation of the documentation, on variable
you have to provide the height, so animating your elements should not interfere with it.
About uniform
, I've tried to enable it on but it didn't work out of the box. So, if you think it might be useful I might give it a second try (but I might need to touch more code).
@@ -126,6 +136,7 @@ module.exports = class ReactList extends Component { | |||
window.removeEventListener('resize', this.updateFrame); | |||
this.scrollParent.removeEventListener('scroll', this.updateFrame, PASSIVE); | |||
this.scrollParent.removeEventListener('mousewheel', NOOP, PASSIVE); | |||
clearTimeout(this.updateFrameTimeoutId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's check if this.updateFrameTimeoutId
exists first. I believe some JS interpreters throw when trying to clearTimeout
on undefined
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking the timeout is superfluous (see MDN note).
Hey guys, any updates on this PR? |
I think we need to confirm which types this can work with. |
Would a fix like this be needed for |
In order to allow items animation
3d60890
to
8664305
Compare
Add
stableFrameDelay
prop for simple list in order to allow items animation.Closes #166