-
Notifications
You must be signed in to change notification settings - Fork 27
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
Redraws called from a didRecycle hook are ignored. #247
Comments
I looked into this with Clay yesterday, and it seems to me that the drainQueue function is where the problem lies. Redraws during other hooks, and during render functions are also affected (for example,
The Instead the function should extract the array, clear the queue, and then requeue the drain call if the queue has new entries. Something like this (untested, off the cuff):
I can take care of this if you wish. May want to consider a counter to limit the number of cycles as a failsafe; after, say, 1000 redraws interrupt the cycle with a log message indicating so. |
When a redraw is called and
didRecycle
is triggered on an element, ifdidRecycle
subsequently makes changes and calls another redraw, the second redraw is ignored and changes aren't reflected until something else triggers another redraw.Minimal example demonstrating issue: https://jsfiddle.net/2j3phtag/. Here you'll see that the recycle lags one behind the main counter, until the view is updated apart from the recycle hook.
The use-case we have is that when a node is recycled its required size may overflow the bounds of its container, in which case we activate scroller buttons. If we do so, we need to trigger another redraw with the buttons now visible. We expected that just calling redraw would be sufficient.
The text was updated successfully, but these errors were encountered: