-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Fix: issue #7001 #7002
Fix: issue #7001 #7002
Conversation
By analyzing the blame information on this pull request, we identified @kmagiera, @andreicoman11 and @dmmiller to be potential reviewers. |
@godness84 updated the pull request. |
@kmagiera would you mind taking a look at this pull request? It's been a while since the last commit was reviewed. |
@godness84 I'm not sure I understand the issue well - could you show a GIF of how it's broken? Sorry for the long delay! |
If you use a normal |
Yes, definitely. Using a normal
|
Neither the ScrollView, nor the HorizontalScrollView have this issue, but neither of them override |
In ReactNative the items are added to the scrollview while scrolling, Just few initial items are added to the scrollview at startup (it depends on the pagesize). When the RecycleView is scrolled, new items are added. These items are added to the adapter and the RecycleView is informed that it should refresh its content. The RecycleView enqueues these updates and performs them if the layout pass has been happened ('mFirstLayoutComplete' stores this information) otherwise it will wait for the layout pass to happen. ReactNative uses its own layout system and bypass the normal one, it layouts the views before adding them to the view hierarchy. The RecycleView is expecting to be added to the hierarchy and that a layout pass will occur. RecycleView overrides the 'onAttachedToWindow' method and set the value of Indeed, if you rotate the device a new layout pass is triggered, and the RecycleView will show the new items added by React, and it will always show new items added during scrolling, because My fix is simulating a new layout pass calling the |
any news? |
I feel like you have explained why adding an extra |
@godness84 still planning to ship this? |
@hramos if the other option is to leave the issue unfixed, yes, I would like to see it shipped. When I wrote this fix, I already knew that it would have seemed a hack. The difficulties to make it shipped mean that the code review of ReactNative is quite hard, and I appreciate it. These are my thoughts about this fix:
I hope to have been able to explain in detail why this fix is the best fix currently :) |
Why do you use the |
@mkonicek I used So ok, let's kill it :) |
At this point it seems like the right way to go is for Martin to just kill the |
Something went wrong executing that command, @mkonicek could you take a look? |
Something went wrong executing that command, @mkonicek could you take a look? |
Something went wrong executing that command, @mkonicek could you take a look? |
It fixes the issue #7001