Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
New worklets gave the drag handlers a new identity, which re-ran the cleanup effect of every item: it removed their measurements and ended an active drag. The trigger is now read from a shared value.
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
The worklets that trigger haptics are memoized and capture the trigger when they are created. With
hapticsEnabled={false}on the first render the captured trigger wasnull, so turning haptics on later had no effect until the sortable was remounted.The trigger is now read from a shared value, so the same worklets pick it up when the prop changes. They keep their identity on purpose: new worklets would give the drag handlers a new identity too, which ends an active drag and re-runs the cleanup effect of every item. Nothing is loaded while haptics are disabled, as before.
Testing
New jest test, fails on main.
before-test-on-main.txtafter-test-with-fix.txt