Skip to content

Fix card focus transitions and scroll offset synchronization on iOS. - #1970

Merged
davidz25 merged 1 commit into
mainfrom
vtl-ios-another-bugfix
Aug 29, 2026
Merged

Fix card focus transitions and scroll offset synchronization on iOS.#1970
davidz25 merged 1 commit into
mainfrom
vtl-ios-another-bugfix

Conversation

@davidz25

Copy link
Copy Markdown
Contributor

Update VerticalCardList on iOS to properly synchronize scroll offsets and focus states during card transitions:

  • Update ScrollViewObserver to synchronize UIScrollView's content offset with scrollOffset without artificial clamping or dropping updates when top insets are still resolving.
  • Only update scrollOffset in the observer when the user is actively dragging or decelerating to avoid clobbering existing scroll offsets when pushing new destination views onto a navigation stack.
  • Correctly resolve effectiveFocusedId and internalFocusedCard during reverse animations so unfocusing smoothly animates in-place.
  • Ensure internalFocusedCardIdentifier initializes immediately on appear when the focused card is already set.

Fixes #1961. (For real, this time, again.)

Test: Verified card focusing, unfocusing, and scrolling behavior in
SwiftTestApp and Multipaz Wallet on iOS Simulator and iPhone 15 Pro.

Update `VerticalCardList` on iOS to properly synchronize scroll offsets and
focus states during card transitions:

- Update `ScrollViewObserver` to synchronize `UIScrollView`'s content offset
  with `scrollOffset` without artificial clamping or dropping updates when
  top insets are still resolving.
- Only update `scrollOffset` in the observer when the user is actively dragging
  or decelerating to avoid clobbering existing scroll offsets when pushing new
  destination views onto a navigation stack.
- Correctly resolve `effectiveFocusedId` and `internalFocusedCard` during
  reverse animations so unfocusing smoothly animates in-place.
- Ensure `internalFocusedCardIdentifier` initializes immediately on appear
  when the focused card is already set.

Fixes #1961. (For real, this time, again.)

Test: Verified card focusing, unfocusing, and scrolling behavior in
      SwiftTestApp and Multipaz Wallet on iOS Simulator and iPhone 15 Pro.
Signed-off-by: David Zeuthen <zeuthen@gmail.com>
@davidz25
davidz25 merged commit 4a12eb4 into main Aug 29, 2026
4 checks passed
@davidz25
davidz25 deleted the vtl-ios-another-bugfix branch August 29, 2026 14:19
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.

VerticalCardList issues

1 participant