On my iPad with Stage Manager on swiping to my app from another app that has the keyboard open makes my app shift up

I have created a simple debug app using Swift/SwiftUI to understand this issue I have seen in my app. The debug app is just a VStack with .border(Color.red). It has text in the upper left, upper right, and bottom so the red rectangle goes around the entire screen. This is done just using VStack{}, HStack{}, Text(), and Spacer().

I have my debug app running and then bring up another app (gmail, google keep, and duck-duck-go browser all work). I open the keyboard in this other app. I swipe my finger from left to right on the bottom of the screen to go back to my app. When it first opens it looks correct but within a second or two the bottom of the red rectangle and the word on the bottom of my debug app move up about where they would be if there was a keyboard, but there is no keyboard.

Some findings:

  • Rotating the iPad does not fix the issue.
  • With stage manager off this doesn't happen.
  • Adding "sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)" to a UIApplication extension and calling that doesn't fix it.
  • Adding a TextField() and touching that to bring up the keyboard and then calling the UIApplication extension does fix it.
  • Going to another app and back fixes it assuming the other app doesn't have the keyboard open.
  • Not all applications with the keyboard open will cause this issue.
  • Issue happens in landscape and portrait rotation
  • If I add a GeometryReader and add Text() to show it and the UIScreen.main.bounds, the bounds don't change with/without issue but geometry does

My system:

  • 11in M1 iPad pro running 16.6.1. 512GB with Stage Manager on
  • Xcode 14.3.1

Other apps don't have this issue so what am I missing? Thanks for any help.

The debug app:

struct ContentView: View {
    var body: some View {
        VStack {
            HStack {
                Text("Top")
                Spacer()
                Text("Top")
            }
            Spacer()
            Text("Bottom")
        }.border(Color.red)
    }
}

...Gary

Adding .ignoreSafeArea(.keyboard) to the outside VStack makes it so the red rectangle doesn't change but this isn't what I want on my real app as I do want to react to the keyboard when it is actually there.

Aka this isn't a solution.

Here are a few more observations:

  • when .ignoreSafeArea(.keyboard) is used to make this simple debug app look correct an added GeometryReader still shows the height being adjusted down.
  • an added GeometryReader shows exactly the same height with this issue happens as when a keyboard is opened up.
  • looking at the scenePhase using "@Environment(.scenePhase) var scenePhase" the debug app shows up normal while phase is Inactive but as it changes to Active the shift in the app occurs.

Other apps I see showing signs of this issue but not as noticeable as the debug app. Below is what happens when go from duck-duck-go web browser with keyboard open to these apps:

  • Google Keep: The "+" and paint palette icon from bottom of screen move up
  • Apple Developer App: In "Developer Tools" shows "No Search Results" that shifts up as app becomes Active
  • Apple Contacts: Left side has list of contacts with alphabet on its right side. When app goes active the alphabet shrinks up like it does when the keyboard is opened.
On my iPad with Stage Manager on swiping to my app from another app that has the keyboard open makes my app shift up
 
 
Q