updated placeholder logic

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-07-10 16:33:54 -05:00
parent d7086b0702
commit d943202e83

View File

@ -45,11 +45,7 @@ open class TextView: UITextView, ViewProtocol, Errorable {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
open var placeholder: String? {
didSet {
placeholderLabel.text = placeholder
}
}
open var placeholder: String? { didSet { setNeedsUpdate() } }
open var placeholderLabel = Label().with {
$0.textColorConfiguration = ViewColorConfiguration().with {
@ -319,8 +315,9 @@ open class TextView: UITextView, ViewProtocol, Errorable {
attributedText = nil
}
placeholderLabel.textStyle = textStyle
placeholderLabel.isHidden = !text.isEmpty
placeholderLabel.surface = surface
placeholderLabel.text = placeholder
placeholderLabel.isHidden = !text.isEmpty
}
}