You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: reorder swap boundaries drift with fractional row heights #31670
I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v9.x
Current Behavior
With fractional-height rows, the point at which dragged items swap drifts further out of alignment down the list. Reordering behaves normally near the top, but becomes noticeably incorrect further down.
Expected Behavior
The swap point should stay consistent regardless of the row's position in the list.
Steps to Reproduce
Open the reproduction, which renders 300 rows with a 64.5px-high content block in each item.
Drag a row near the top and observe the swap point.
Scroll to around row 60, then row 120, and repeat. The swap point becomes increasingly displaced.
Change the content block height from 64.5px to 65px. The drift disappears.
This is the output from running npx --yes --package=@ionic/cli ionic info in the StackBlitz terminal:
Ionic:
Ionic CLI : 7.2.1
Utility:
cordova-res : not installed globally
native-run : not installed globally
System:
NodeJS : v22.22.3
npm : 10.8.2
OS : Linux 5.0
Additional Information
The reorder group sums child.offsetHeight to cache row boundaries. A rendered height of 64.5px is rounded to 65px, accumulating a 0.5px error per row. In the affected app, the measured boundary error reaches 31.5px after 63 rows. Forcing whole-pixel row heights fixes the behavior.
Verified on 9.0.10, and your diagnosis is right. When a drag starts, ion-reorder-group works out where each row ends by adding up each item's offsetHeight, which is always a whole number. A 65.5px item counts as 66px, so the extra half pixel builds up row by row: the swap point is about 31px late by row 62 and 150px late by row 299. Any item with a fractional height is affected, whatever makes it fractional, in both ios and md modes.
Workaround, verified on 9.0.10:
Keep item heights at whole pixels, as you found. In the reproduction, changing the content block from 64.5px to 65px brings the error to 0 at every row.
Activity
thetaPC commentedon Oct 29, 2026
Thanks for the report.
Verified on 9.0.10, and your diagnosis is right. When a drag starts,
ion-reorder-groupworks out where each row ends by adding up each item'soffsetHeight, which is always a whole number. A 65.5px item counts as 66px, so the extra half pixel builds up row by row: the swap point is about 31px late by row 62 and 150px late by row 299. Any item with a fractional height is affected, whatever makes it fractional, in bothiosandmdmodes.Workaround, verified on 9.0.10:
64.5pxto65pxbrings the error to 0 at every row.Tracked as a bug in
core.