[Overview] After building the UI with SwiftUI, when the data is updated through an API, new data is added at the top of the ScrollView, and new UI blocks are added. However, the scroll position remains at the previous location, and it does not move to the top.
[Reproduction Steps]
Build the view using ScrollView and LazyVGrid. In the LazyVGrid, set up blocks A/B/C/D/E to appear conditionally (using ForEach and Switch). Initially, the array only contains C/D/E. After the API call, add A/B to the array. [Details] This issue does not occur on all devices and has been occurring since iOS 18.1. The affected device list is as follows:
iPhone 14 Pro iPhone 15 Pro iPhone 16 Pro Max If this issue occurred equally across all devices, the resolution would be quicker. However, please note that it only occurs on some devices. Below is a part of the code I wrote:
[MainV]
RefreshableScrollView(onRefresh: { done in
// pullToRefresh Action
......
},
progress: { _ in
...
},
detectOffSetY: { offsetY in
// Scroll Detect Action
...
}) {
switch tab.item {
case .home:
HomeView(store: homeStore)
.onAppear {
homeViewStore.send(.blurblur {
tabbarAction blurblur
})
}
[HomeView]
Section(
header: HomeNaviView(data: navidata,
naviShadowShowYn: Yn)
) {
ForEach(viewStore.state.menuList, id: \.self) { menu in
switch menu {
case .A:
A(data: data)
case .B:
B(data: data)
case .C:
C(data: data)
P.S. The structure is SwiftUI + TCA, and the TCA version is 1.12.0 or later.