From d943202e8389b2b666499e753694fa515b46138f Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 10 Jul 2024 16:33:54 -0500 Subject: [PATCH] updated placeholder logic Signed-off-by: Matt Bruce --- VDS/Components/TextFields/TextArea/TextView.swift | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/VDS/Components/TextFields/TextArea/TextView.swift b/VDS/Components/TextFields/TextArea/TextView.swift index 3f40ae38..3c5dc5ee 100644 --- a/VDS/Components/TextFields/TextArea/TextView.swift +++ b/VDS/Components/TextFields/TextArea/TextView.swift @@ -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 } }