Dimillian / RedditOS

The product name is Curiosity, a SwiftUI Reddit client for macOS Big Sur

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When switching windows, the destination view is lost.

Sugimoto-Dev opened this issue · 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!