Is it possible to scroll to item in SwiftUI List when the view appears on Apple Watch?

I have checked everything but this doesn't appear to work. Here is the part of the code used for that - simplified my view looks like this:

        ScrollViewReader { scroll in
            List(voices) { item in
                Button(item.title) { }
                .fontWeight(item.id == selected ? .bold : .regular)

            }
            .onAppear() {
                scroll.scrollTo(selected, anchor: .center)
            }
        }

selected is properly shown as bold, so the value is proper. But the app doesn't scroll to it. I have tried various things like dispatching on main thread and even dispatching on main thread after 1 second, but nothing helps.

However that scroll code works when being called from the Button.

Is this a bug on watchOS?

  • I can’t edit but to note that selected is assigned in OnAppear so it has a proper value when being Called for scrolling.

Add a Comment

Replies

This appears to be the bug as now I have noticed that scroll indicator is shown properly just list doesn't actually scroll.

Can someone from Apple at least confirm it is a bug?