diff --git a/MVMCoreUI/Atoms/TextFields/EntryField.swift b/MVMCoreUI/Atoms/TextFields/EntryField.swift index cafa91be..551d188d 100644 --- a/MVMCoreUI/Atoms/TextFields/EntryField.swift +++ b/MVMCoreUI/Atoms/TextFields/EntryField.swift @@ -116,8 +116,7 @@ import UIKit set (newFeedback) { feedbackLabel.text = newFeedback feedbackLabel.accessibilityElementsHidden = feedbackLabel.text?.isEmpty ?? true - entryFieldContainer.refreshUI() -// delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self) + entryFieldContainer.refreshUI(moleculeLayoutUpdated: true) } } diff --git a/MVMCoreUI/Containers/Views/EntryFieldContainer.swift b/MVMCoreUI/Containers/Views/EntryFieldContainer.swift index 773721f7..3755a411 100644 --- a/MVMCoreUI/Containers/Views/EntryFieldContainer.swift +++ b/MVMCoreUI/Containers/Views/EntryFieldContainer.swift @@ -260,14 +260,22 @@ import UIKit refreshUI(bottomBarSize: 1) } - open func refreshUI(bottomBarSize: CGFloat? = nil) { + open func refreshUI(bottomBarSize: CGFloat? = nil, moleculeLayoutUpdated: Bool = false) { if !disableAllBorders { let size: CGFloat = bottomBarSize ?? (showError ? 4 : 1) + var heightChanged = false + + if let bottomHeight = bottomBar?.bounds.height { + heightChanged = size != bottomHeight + } bottomBar?.frame = CGRect(x: 0, y: bounds.height - size, width: bounds.width, height: size) - delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self) - setNeedsDisplay() + if moleculeLayoutUpdated || heightChanged { + delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self) + setNeedsDisplay() + } + layoutIfNeeded() } }