Repository navigation
Conversation
The cleanup that removes the measurements of an item also runs when React only hides the tree (Activity). The item does not report its layout again when it is shown, so nothing restored the measurements: the layout stopped updating and items could not be dragged. The measurements are now removed only for items that are no longer rendered.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Also covers an item added after the sortable is hidden and shown again, measured through its onLayout.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Each item removes its measurements in an effect cleanup. React also runs effect cleanups when it only hides a tree, for example with
<Activity mode='hidden'>. The items keep their size while hidden and do not report their layout again when they are shown, so nothing restored the measurements: after hiding and showing a sortable its layout stopped updating and items could not be dragged any more.The measurements are now removed only for items that are no longer rendered. This also means that a change of the cleanup dependencies can no longer wipe the measurements of mounted items. An item for which
renderItemreturnsundefinedis stored asnull, so that it is not taken for one that is no longer rendered.Testing
New jest tests with
<Activity>(the three hide and show cases fail on main, where all measurements are gone). Adding, removing and dragging items in the Data Change example still works on the iOS simulator (Fabric).before-tests-on-main.txtafter-tests-with-fix.txt