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() {