From 315601e048c5e4e2b8bf205c94c563e5d945418c Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 1 Jul 2024 15:26:51 -0500 Subject: [PATCH] CXTDT-577463 - InputField - Accessibility - #1 Typing Feedback Signed-off-by: Matt Bruce --- VDS/Components/TextFields/InputField/InputField.swift | 8 +++++++- VDS/Components/TextFields/TextArea/TextArea.swift | 11 ++++++++++- VDS/SupportingFiles/ReleaseNotes.txt | 2 ++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/VDS/Components/TextFields/InputField/InputField.swift b/VDS/Components/TextFields/InputField/InputField.swift index f7f54896..11a8ae17 100644 --- a/VDS/Components/TextFields/InputField/InputField.swift +++ b/VDS/Components/TextFields/InputField/InputField.swift @@ -105,6 +105,8 @@ open class InputField: EntryFieldBase { $0.translatesAutoresizingMaskIntoConstraints = false $0.textStyle = TextStyle.bodyLarge $0.isAccessibilityElement = false + $0.autocorrectionType = .no + $0.spellCheckingType = .no } /// Color configuration for the textField. @@ -360,7 +362,11 @@ extension InputField: UITextFieldDelegate { } public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { - return fieldType.handler().textField(self, textField: textField, shouldChangeCharactersIn: range, replacementString: string) + let shouldChange = fieldType.handler().textField(self, textField: textField, shouldChangeCharactersIn: range, replacementString: string) + if shouldChange { + UIAccessibility.post(notification: .announcement, argument: string) + } + return shouldChange } } diff --git a/VDS/Components/TextFields/TextArea/TextArea.swift b/VDS/Components/TextFields/TextArea/TextArea.swift index d0396d7a..c668a851 100644 --- a/VDS/Components/TextFields/TextArea/TextArea.swift +++ b/VDS/Components/TextFields/TextArea/TextArea.swift @@ -101,6 +101,7 @@ open class TextArea: EntryFieldBase { $0.isScrollEnabled = true $0.textContainerInset = .zero $0.autocorrectionType = .no + $0.spellCheckingType = .no $0.textContainer.lineFragmentPadding = 0 } @@ -132,6 +133,7 @@ open class TextArea: EntryFieldBase { super.setup() accessibilityHintText = "Double tap to edit" + textView.delegate = self //events textView @@ -226,7 +228,7 @@ open class TextArea: EntryFieldBase { } } - func textViewDidChange(_ textView: UITextView) { + public func textViewDidChange(_ textView: UITextView) { //dynamic textView Height sizing based on Figma //if you want it to work "as-is" delete this code @@ -288,3 +290,10 @@ open class TextArea: EntryFieldBase { //-------------------------------------------------- var countRule = CharacterCountRule() } + +extension TextArea: UITextViewDelegate { + public func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { + UIAccessibility.post(notification: .announcement, argument: text) + return true + } +} diff --git a/VDS/SupportingFiles/ReleaseNotes.txt b/VDS/SupportingFiles/ReleaseNotes.txt index 12661050..0be4ba37 100644 --- a/VDS/SupportingFiles/ReleaseNotes.txt +++ b/VDS/SupportingFiles/ReleaseNotes.txt @@ -1,6 +1,8 @@ 1.0.70 ---------------- +- CXTDT-577463 - InputField - Accessibility - #1 Typing Feedback - CXTDT-560485 - Tilelet - Accessibility Icons +- DatePicker - Final logic for how the calendar shows. 1.0.69 ----------------