Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Request for new functionality
View staffing
Description
Jetpack Compose version:
composeBom = "2024.11.00"
Jetpack Compose component(s) used:
HorizontalPager
Steps to Reproduce or Code Sample to Reproduce:
A standalone composable is available as a GitHub gist:https://gist.github.com/tkuenneth/e116a410e2afe19261a9590fb936aa46
Please use Run Preview to run.
The sample code uses
HorizontalPager()
to show two pages with 4 (first page) and 2 (second page) draggable blocks. Dragging a box from one slot to another replaces the boxes. The samples uses thedragAndDropTarget()
anddragAndDropSource()
modifiers.Issue: trying to drag a box from one page to another does not work, because
HorizontalPager()
does not support this. To make this work,HorizontalPager()
would need to automatically scroll to the next or previous page, if the dragged item reaches the left or right border of the pager.There is a workaround:
Unfortunately, this feels hacky, because it works only if
beyondViewportPageCount
is set. This is not done in the sample, therefore the sample won't workTherefore,
HorizontalPager()
should be allowed to become part of a drag and drop operation.