From 99cbadb35adafb7d5bf4b9f507225d4257d41286 Mon Sep 17 00:00:00 2001 From: Alpha Date: Mon, 4 May 2026 17:25:42 -0400 Subject: [PATCH 1/2] fix(ios): persist position during page list head changes Fixes #965 --- ios/PagerViewProvider.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ios/PagerViewProvider.swift b/ios/PagerViewProvider.swift index 54fb5177..7e0f8ecd 100644 --- a/ios/PagerViewProvider.swift +++ b/ios/PagerViewProvider.swift @@ -74,6 +74,9 @@ import UIKit return } props.children.insert(IdentifiablePlatformView(child), at: index) + if index <= props.currentPage { + props.currentPage += 1 + } } @objc(removeChildAtIndex:) @@ -82,6 +85,9 @@ import UIKit return } props.children.remove(at: index) + if index < props.currentPage { + props.currentPage -= 1 + } } override public func didMoveToWindow() { From b12359a5a71b8e1fe8d7404b3dfc2b9a40165fc1 Mon Sep 17 00:00:00 2001 From: Alpha Date: Wed, 13 May 2026 15:19:55 -0400 Subject: [PATCH 2/2] fix(ios): avoid end scroll on full data swap --- ios/PagerViewProvider.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/PagerViewProvider.swift b/ios/PagerViewProvider.swift index 7e0f8ecd..9636edc2 100644 --- a/ios/PagerViewProvider.swift +++ b/ios/PagerViewProvider.swift @@ -73,10 +73,10 @@ import UIKit guard index >= 0 && index <= props.children.count else { return } - props.children.insert(IdentifiablePlatformView(child), at: index) - if index <= props.currentPage { + if index <= props.currentPage && props.currentPage < props.children.count { props.currentPage += 1 } + props.children.insert(IdentifiablePlatformView(child), at: index) } @objc(removeChildAtIndex:)