diff --git a/Sources/LiveViewNative/Views/Layout Containers/Collection Containers/List.swift b/Sources/LiveViewNative/Views/Layout Containers/Collection Containers/List.swift index 6d7a02ae8..e730367ea 100644 --- a/Sources/LiveViewNative/Views/Layout Containers/Collection Containers/List.swift +++ b/Sources/LiveViewNative/Views/Layout Containers/Collection Containers/List.swift @@ -208,6 +208,7 @@ struct List: View { } } } + .opacity((id == nil || didAttemptRestoration) ? 1 : 0) // prevent flickering when restoring .task { defer { didAttemptRestoration = true } @@ -216,6 +217,12 @@ struct List: View { else { return } scrollProxy.scrollTo(restoreID, anchor: .top) + + // wait for the next runloop and try to scroll again + // it seems that the scroll won't work if the elements are not laid-out yet + try! await Task.sleep(for: .nanoseconds(0)) + + scrollProxy.scrollTo(restoreID, anchor: .top) } } }