CXTDT-577463 - InputField - Accessibility - #1 Typing Feedback

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-07-01 15:26:51 -05:00
parent 72e86dafc2
commit 315601e048
3 changed files with 19 additions and 2 deletions

View File

@ -105,6 +105,8 @@ open class InputField: EntryFieldBase {
$0.translatesAutoresizingMaskIntoConstraints = false $0.translatesAutoresizingMaskIntoConstraints = false
$0.textStyle = TextStyle.bodyLarge $0.textStyle = TextStyle.bodyLarge
$0.isAccessibilityElement = false $0.isAccessibilityElement = false
$0.autocorrectionType = .no
$0.spellCheckingType = .no
} }
/// Color configuration for the textField. /// Color configuration for the textField.
@ -360,7 +362,11 @@ extension InputField: UITextFieldDelegate {
} }
public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { 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
} }
} }

View File

@ -101,6 +101,7 @@ open class TextArea: EntryFieldBase {
$0.isScrollEnabled = true $0.isScrollEnabled = true
$0.textContainerInset = .zero $0.textContainerInset = .zero
$0.autocorrectionType = .no $0.autocorrectionType = .no
$0.spellCheckingType = .no
$0.textContainer.lineFragmentPadding = 0 $0.textContainer.lineFragmentPadding = 0
} }
@ -132,6 +133,7 @@ open class TextArea: EntryFieldBase {
super.setup() super.setup()
accessibilityHintText = "Double tap to edit" accessibilityHintText = "Double tap to edit"
textView.delegate = self
//events //events
textView 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 //dynamic textView Height sizing based on Figma
//if you want it to work "as-is" delete this code //if you want it to work "as-is" delete this code
@ -288,3 +290,10 @@ open class TextArea: EntryFieldBase {
//-------------------------------------------------- //--------------------------------------------------
var countRule = CharacterCountRule() 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
}
}

View File

@ -1,6 +1,8 @@
1.0.70 1.0.70
---------------- ----------------
- CXTDT-577463 - InputField - Accessibility - #1 Typing Feedback
- CXTDT-560485 - Tilelet - Accessibility Icons - CXTDT-560485 - Tilelet - Accessibility Icons
- DatePicker - Final logic for how the calendar shows.
1.0.69 1.0.69
---------------- ----------------