File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Sources/KeyboardLayoutGuide Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -122,12 +122,16 @@ open class KeyboardLayoutGuide: UILayoutGuide {
122122 let intersectionFrame = activeWindow. frame. intersection ( owningFrameInRoot)
123123
124124 let windowHeight = activeWindow. frame. height
125- let bottomDifference = windowHeight - ( intersectionFrame. height + intersectionFrame . origin . y )
125+ let bottomDifference = windowHeight - intersectionFrame. maxY
126126
127127 height -= bottomDifference
128128 }
129129
130-
130+ guard height != . infinity else {
131+ // When the app is running in multiple windows, it can happen that both windows are `foregroundActive`
132+ // and the intersection frame's origin can become infinite as the owning view is in the other window and the app would crash.
133+ return
134+ }
131135 heightConstraint? . constant = height
132136 if duration > 0.0 {
133137 animate ( note)
You can’t perform that action at this time.
0 commit comments