Skip to content

Commit

Permalink
Fixing height for badgefield when there is text and keyboard is hidden (
Browse files Browse the repository at this point in the history
microsoft#260)

* Fixing height for badgefield when there is text and keyboard is hidden

* comments resolving
  • Loading branch information
kiagrawal authored Oct 15, 2020
1 parent dc7cc2d commit fdd6307
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ios/FluentUI/Badge Field/BadgeField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,9 @@ open class BadgeField: UIView {
calculateBadgeFrame(badge: badge, badgeIndex: index, lineIndex: &lineIndex, left: &left, topMargin: 0, boundingWidth: bounds.width)
}

if isEditable && isFirstResponder && left + Constants.textFieldMinWidth > boundingWidth {
let isFirstResponderOrHasTextFieldContent = isFirstResponder || !textFieldContent.isEmpty

if isEditable && isFirstResponderOrHasTextFieldContent && left + Constants.textFieldMinWidth > boundingWidth {
lineIndex += 1
}
let textFieldSize = textField.sizeThatFits(CGSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude))
Expand Down

0 comments on commit fdd6307

Please sign in to comment.