Skip to content

Commit

Permalink
- fixed an issue when the heightConstraint receives an infinite value
Browse files Browse the repository at this point in the history
  • Loading branch information
BalazsSzamody committed Apr 22, 2022
1 parent 30b2942 commit 227ce4f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/KeyboardLayoutGuide/KeyboardLayoutGuide.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ open class KeyboardLayoutGuide: UILayoutGuide {
height -= bottomDifference
}


guard height != .infinity else {
// When the app is running in multiple windows, it can happen that both windows are `foregroundActive`
// and the intersection frame's origin can become infinite as the owning view is in the other window and the app would crash.
return
}
heightConstraint?.constant = height
if duration > 0.0 {
animate(note)
Expand Down

0 comments on commit 227ce4f

Please sign in to comment.