Success Criterion 3.2.2 - Level A
On Input
Ensure it is predictable what happens when entering data. If the focus is automatically moved upon input, this must be indicated in advance. Avoid this behavior for input fields and checkboxes, among others. Unexpected actions can particularly confuse users with visual or cognitive impairments.
Impact
Users with visual or cognitive impairments may be confused by unexpected actions.
Check
“Are there any unexpected actions while entering data?”
This can be tested without assistive technologies.
Solution
Check input behavior
On Android, be careful when using TextWatcher
methods. Do not trigger a change of context when text changes.
private val textWatcher = object : TextWatcher {
override fun afterTextChanged(s: Editable?) {
// Ignored
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
// Ignored
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
// Do not change context
}
}