Skip to content

Fix stale drag callbacks in draggable modifier#120

Open
saadkhalidkhan wants to merge 1 commit into
Calvin-LL:mainfrom
saadkhalidkhan:fix/stale-drag-callbacks
Open

Fix stale drag callbacks in draggable modifier#120
saadkhalidkhan wants to merge 1 commit into
Calvin-LL:mainfrom
saadkhalidkhan:fix/stale-drag-callbacks

Conversation

@saadkhalidkhan

@saadkhalidkhan saadkhalidkhan commented Jun 18, 2026

Copy link
Copy Markdown

Summary

  • Use rememberUpdatedState for onDragStarted, onDragStopped, and onDrag in the internal draggable modifier
  • Ensures DisposableEffect cleanup and pointer gesture handlers always invoke the latest lambdas

Fixes #102

Test plan

  • :reorderable:compileKotlinJvm succeeds
  • Drag an item with onDragStopped that reads current composition state and verify the latest value is used after recomposition

Use rememberUpdatedState for onDragStarted, onDragStopped, and onDrag so DisposableEffect and pointerInput always invoke the latest lambdas.

Fixes Calvin-LL#102
@saadkhalidkhan saadkhalidkhan force-pushed the fix/stale-drag-callbacks branch 3 times, most recently from 756dfef to c62e37a Compare June 18, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

onDragStopped / onDragStarted are not properly updated

1 participant