Dimillian/RedditOS

When switching windows, the destination view is lost.

Sugimoto-Dev opened this issue · 3 comments

2020-07-1515-21-36.2020-07-1515_24_03

I don't know why this is happening, the view is not lost on catalina.

I guess it's just a SwiftUI Big Sur bug. We'll see in next beta.

I ran into this in my macOS Reddit app a few days ago, it's because there isn't a detail view SubredditPostsListView. If you add a detail view placeholder like Text("Choose a post") after the List, SwiftUI will retain the rendered detail view when you change focus.

It does seem like a regression, since in Catalina the selection was retained without having to supply a detail view place holder

I ran into this in my macOS Reddit app a few days ago, it's because there isn't a detail view SubredditPostsListView. If you add a detail view placeholder like Text("Choose a post") after the List, SwiftUI will retain the rendered detail view when you change focus.

It does seem like a regression, since in Catalina the selection was retained without having to supply a detail view place holder

I tested it the way you said, you are right! Thank you very much!