        (`UIApplication.shared.statusBarFrame.height`). Used for form sheet modals.
      */
     public func adjustConstraint(for keyboardFrame: CGRect, constraint: NSLayoutConstraint? = nil, statusBarHeight: CGFloat = 0.0) {
+        guard keyboardFrame.height > 0 else { setConstant(of: constraint, to: 0); return }
         let adjustedConstant = self.adjustedConstant(for: keyboardFrame, statusBarHeight: statusBarHeight)
-        let constraint = constraint ?? constraintToAdjust
-        constraint?.constant = adjustedConstant
-        UIView.animate(withDuration: 0.3, delay: 0.0, usingSpringWithDamping: 1.0, initialSpringVelocity: 1.0, options: [], animations: {
-            self.view.layoutIfNeeded()
-        }, completion: nil)
+        setConstant(of: constraint, to: adjustedConstant)
     }
     
     func adjustedConstant(for keyboardFrame: CGRect, statusBarHeight: CGFloat = 0.0) -> CGFloat {

     Call this function from `keyboardWillHide` in order to have the constraint constant reset back to zero.
     */
    public func keyboardWillDisappear(constraint: NSLayoutConstraint? = nil) {
        if let constraint = constraint {
            constraint.constant = 0
        } else {
            constraintToAdjust?.constant = 0
        }
    }

}

        if modalPresentationStyle == .formSheet || navigationController?.modalPresentationStyle == .formSheet {
            maxY = wrapper.frame.height + statusBarHeight
        }
        maxY = min(maxY, window.frame.maxY)
        let offset = maxY - keyboardFrame.origin.y
        return max(offset, 0)
    }
