fixed issue with showing errorIcon without error message
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
d943202e83
commit
46d4098cf2
@ -453,27 +453,34 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
||||
}
|
||||
|
||||
open func updateErrorLabel(){
|
||||
if showError, let errorText {
|
||||
errorLabel.text = errorText
|
||||
errorLabel.surface = surface
|
||||
errorLabel.isEnabled = isEnabled
|
||||
errorLabel.isHidden = false
|
||||
statusIcon.name = .error
|
||||
statusIcon.surface = surface
|
||||
statusIcon.isHidden = !isEnabled || state.contains(.focused)
|
||||
} else if hasInternalError, let internalErrorText {
|
||||
errorLabel.text = internalErrorText
|
||||
errorLabel.surface = surface
|
||||
errorLabel.isEnabled = isEnabled
|
||||
errorLabel.isHidden = false
|
||||
|
||||
/// always show the errorIcon if there is an error
|
||||
if showError || hasInternalError {
|
||||
statusIcon.name = .error
|
||||
statusIcon.surface = surface
|
||||
statusIcon.isHidden = !isEnabled || state.contains(.focused)
|
||||
} else {
|
||||
statusIcon.isHidden = true
|
||||
errorLabel.isHidden = true
|
||||
}
|
||||
statusIcon.color = iconColorConfiguration.getColor(self)
|
||||
|
||||
// only show errorLabel if there is a message
|
||||
var message: String?
|
||||
if showError, let errorText {
|
||||
message = errorText
|
||||
} else if hasInternalError, let internalErrorText {
|
||||
message = internalErrorText
|
||||
}
|
||||
|
||||
if let message {
|
||||
errorLabel.text = message
|
||||
errorLabel.surface = surface
|
||||
errorLabel.isEnabled = isEnabled
|
||||
errorLabel.isHidden = false
|
||||
} else {
|
||||
errorLabel.isHidden = true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
open func updateHelperLabel(){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user