Skip to content

fix: preserve native MVCP position on item resize against a bottom inset#481

Draft
trcoffman wants to merge 2 commits into
LegendApp:mainfrom
trcoffman:fix/mvcp-resize
Draft

fix: preserve native MVCP position on item resize against a bottom inset#481
trcoffman wants to merge 2 commits into
LegendApp:mainfrom
trcoffman:fix/mvcp-resize

Conversation

@trcoffman

Copy link
Copy Markdown
Contributor

Addresses #475

When a virtualized list uses maintainVisibleContentPosition with a bottom contentInset (e.g. KeyboardAwareLegendList's anchoredEndSpace blank), resizing an item above the viewport shifted the content on iOS and Android.

Route item-resize MVCP through the native-clamp handoff whenever the viewport overlaps the inset zone, and:

  • apply the full compensation manually when native has room and would not clamp (partial-inset zone),
  • settle without a further spacer adjust once native has clamped to its true max, so a large shrink pins cleanly at the new end instead of overshooting.

The data-change handoff is unchanged (scoped via isResize).

In these videos, the example has a timer that re-collapses the expanded messages after 5 seconds.

Before

Simulator.Screen.Recording.-.iPhone.17.Pro.Max.-.2026-06-22.at.14.48.59.mov
Simulator.Screen.Recording.-.iPhone.17.Pro.Max.-.2026-06-22.at.14.49.32.mov

After

Simulator.Screen.Recording.-.iPhone.17.Pro.Max.-.2026-06-22.at.14.44.51.mov
Simulator.Screen.Recording.-.iPhone.17.Pro.Max.-.2026-06-22.at.14.46.29.mov

trcoffman and others added 2 commits June 22, 2026 14:41
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a virtualized list uses maintainVisibleContentPosition with a bottom
contentInset (e.g. KeyboardAwareLegendList's anchoredEndSpace blank), resizing
an item above the viewport shifted the content on iOS and Android.

Route item-resize MVCP through the native-clamp handoff whenever the viewport
overlaps the inset zone, and:
- apply the full compensation manually when native has room and would not clamp
  (partial-inset zone),
- settle without a further spacer adjust once native has clamped to its true
  max, so a large shrink pins cleanly at the new end instead of overshooting.

The data-change handoff is unchanged (scoped via isResize).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant