When switching windows, the destination view is lost.
Sugimoto-Dev opened this issue · 3 comments
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 likeText("Choose a post")
after theList
, 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!