Skip to content

fix: Haptics not triggered when hapticsEnabled is turned on after mount - #648

Draft
MatiPl01 wants to merge 2 commits into
mainfrom
fix/haptics-enabled-after-mount
Draft

MatiPl01 wants to merge 2 commits into
mainfrom
fix/haptics-enabled-after-mount

Conversation

@MatiPl01

@MatiPl01 MatiPl01 commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

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 was null, 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.

Evidence
Test on main before-test-on-main.txt
Test with the fix after-test-with-fix.txt

@MatiPl01 MatiPl01 self-assigned this Nov 25, 2026
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
react-native-sortables-docs Ignored Ignored Preview Nov 26, 2026 1:25pm UTC

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant