Issues with List selection in Sequoia (SwiftUI)

In one of my applications I use several List views with Sections. After upgrading to Sequoia I faced the issue, that after selecting an item, the List suddenly scrolls to a different position. Sometimes the selection even gets out of the view, but in every case a double click just went to the wrong item.

At one list I found out, that the issue could be solved after changing the data source. I used a computed property, what seems to be a stupid idea. After changing this it now works.

Unfortunately there is another List, where this didn't bring the solution. And unfortunately, I cannot reproduce the issue in a code example. One guess of mine is, that it could be related to the fact, that the rows have different heights (because in some are two lines of text and in some are three). And it seems to happen only in very long lists.

It worked perfectly in Sonoma.

Does anyone face the same issue?

I just filed a bug (FB15269193). It happens only in very long lists and only when scrolling down the first time. List seems to recalculate the heights of the cells and there must be a bug. I hope, that Apple will fix this in the next release.

@joachim_me Thanks for filling the bug report. I looked at the Sample project and I wasn't able to reproduce the issue. Selecting an item in the List doesn't perform any additional action apart from highlighting the item.

Perhaps is there any additional steps needed to reproduce the issue in the sample code you provided.

Since you're able to reproduce the issue consistently in your actual project, I would suggest you could start with a copy of your existing project, and remove code not essential to the issue. Remove code iteratively, re-testing after every removal. If you find that you can no longer demonstrate the issue after removing a particular piece of code, it’s likely that the issue is within the last-removed code. After restoring this code to the project, keep reducing the surrounding code until everything remaining is essential to the issue.

Thank you very much for your answer. Did you saw the video I made from the behaviour? It's interesting, that you couldn't reproduce. Please scroll nearly to the bottom and then select an item.

In my other project I could solve the problem after deleting everything what was displayed in the list and I only had one Text element. But that surely cannot be the solution ;)

Issues with List selection in Sequoia (SwiftUI)
 
 
Q