From 0981bf77297b6bf9451b5d8decfe59eb3f8ea70a Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 25 Jun 2024 13:46:00 -0500 Subject: [PATCH] updated logic for statusIcon label Signed-off-by: Matt Bruce --- VDS/Components/TextFields/EntryFieldBase.swift | 5 +++++ VDS/Components/TextFields/InputField/InputField.swift | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/VDS/Components/TextFields/EntryFieldBase.swift b/VDS/Components/TextFields/EntryFieldBase.swift index bd9155d1..5bd50351 100644 --- a/VDS/Components/TextFields/EntryFieldBase.swift +++ b/VDS/Components/TextFields/EntryFieldBase.swift @@ -344,6 +344,11 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable { guard let self else { return "" } return value } + + statusIcon.bridge_accessibilityLabelBlock = { [weak self] in + guard let self else { return "" } + return showError || hasInternalError ? "error" : nil + } } /// Updates the UI diff --git a/VDS/Components/TextFields/InputField/InputField.swift b/VDS/Components/TextFields/InputField/InputField.swift index 575e843f..9adf34f2 100644 --- a/VDS/Components/TextFields/InputField/InputField.swift +++ b/VDS/Components/TextFields/InputField/InputField.swift @@ -223,6 +223,16 @@ open class InputField: EntryFieldBase { return accessibilityLabels.joined(separator: ", ") } + statusIcon.bridge_accessibilityLabelBlock = { [weak self] in + guard let self else { return "" } + if showError { + return "error" + } else if showSuccess { + return "success" + } else { + return nil + } + } } open override func getFieldContainer() -> UIView {