material-components / material-components/material-components-android
[TextInputEditText] [TextInputLayout] TalkBack issue when error is displayed
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 17.4k
- Fork
- 3.2k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**Description:** I have a TalkBack issue with TextInputLayout + TextInputEditText combo. I have a form type of screen that presents a number of editable fields (some mandatory, some optional) to the user. I’m performing a form validation when the user selects Save action. If the form is not properly filled (e.g. mandatory info missing, field input is too short or otherwise does not fill the requirements) I set the error message on the TextInputLayout and make requestFocus() -call on the first text field that has an error. The TalkBack will then correctly read the error message but the accessibility focus (green box) stays in the element (ToolBar action) that fired the form validation.
To tackle this issue I started experimenting if I could move the accessibility focus on the text field by making this call:
`inputEdit.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED)`
If I make the call on the TextInputEditText, the behavior will change. Now the accessibility focus will move to the view that has focus and error set but the TalkBack reads the hint text set on the TextInputLayout. If I make the call on the TextInputLayout instead, it doesn’t do anything i.e. TalkBack will read the error message but the accessibility focus is not moved.
**Expected behavior:** There should an easy way (preferably default behavior) to move the accessibility focus and make the TalkBack to read an error message set on the TextInputLayout when the view gets the focus.
**Source code:**
`
`
**Android API version:** Android API 28
**Material Library version:** 1.3.0
**Device:** Sony Xperia (G8441)
To help us triage faster, please check to make sure you are using the [latest version](https://github.com/material-components/material-components-android/releases) of the library.
We also happily accept [pull requests](https://github.com/material-components/material-components-android/pulls).
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo il comportamento di TalkBack a partire dall'XML fornito di TextInputLayout e TextInputEditText su Android API 28, concentrandoti sugli annunci del focus e degli errori. Traccia il comportamento di accessibilità di TextInputLayout e TextInputEditText; il lavoro è terminato quando il focus di accessibilità si sposta sul campo con errore e TalkBack legge l'errore di TextInputLayout quando viene richiesto il focus.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- android
- Ambito
- accessibility, mobile
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100