Skip to content

Commit 227ce4f

Browse files
committed
- fixed an issue when the heightConstraint receives an infinite value
1 parent 30b2942 commit 227ce4f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/KeyboardLayoutGuide/KeyboardLayoutGuide.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ open class KeyboardLayoutGuide: UILayoutGuide {
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)

0 commit comments

Comments
 (0)