Talkback won't read label for text input in Cordova

457 views
Skip to first unread message

Matt Anderson

unread,
Mar 31, 2017, 8:00:15 PM3/31/17
to Eyes-free Programming and development
I'm working on a Cordova app (built with AngularJS and Ionic) and find Talkback works very well in general. However, I can't get it to associate a label with a text input and speak the label when the input gets focus through swipe gestures. I've tried the following markup strategies:

<label for="nickname">{{ strings.nicknameLabel }}</label>
<input id="nickname" type="text" name="nickname" ng-model="thing.nickname">


<label for="nickname">{{ strings.nicknameLabel }}</label>
<input id="nickname" aria-label="{{ strings.nicknameLabel }}" type="text" name="nickname" ng-model="thing.nickname">


<label id="nicknameLabel" for="nickname">{{ strings.nicknameLabel }}</label>
<input id="nickname" aria-labelledby="nicknameLabel" type="text" name="nickname" ng-model="thing.nickname">


So basically every trick in the book. Talkback reads the text of the label when I swipe and the label gets focus, but when the input gets focus it says something like "edit box " and the contents of the text input. I want Talkback to read out the label when the input gets focus, similar to what happens in Chrome.

Dominic Mazzoni

unread,
Mar 31, 2017, 8:16:51 PM3/31/17
to Eyes-free Programming and development
Your markup looks correct to me, and in recent versions of Android & TalkBack that should work fine. What Android version, what Talkback version, and if you have unbundled WebView, what System WebView version?

--
You received this message because you are subscribed to the Google Groups "Eyes-free Programming and development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eyes-free-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt Anderson

unread,
Apr 3, 2017, 1:41:11 PM4/3/17
to Eyes-free Programming and development
Thanks. This is on a Samsung phone with Android 6.0.1. Actually I misspoke, it's not TalkBack I'm testing, it's Voice Assistant (Settings -> Accessibility -> Vision -> Voice Assistant).

Dominic Mazzoni

unread,
Apr 3, 2017, 4:52:13 PM4/3/17
to Eyes-free Programming and development
Maybe compare it to what TalkBack does? You can download that from the Play Store if it didn't come with your phone.

Matt Anderson

unread,
Apr 3, 2017, 5:20:16 PM4/3/17
to Eyes-free Programming and development
I just downloaded TalkBack and checked it - it's behaviour is the same.

Matt Anderson

unread,
Apr 3, 2017, 7:47:40 PM4/3/17
to Eyes-free Programming and development
What happens currently is that the <label> gets focus and TalkBack reads out its text, followed by "double tap to activate". If I double-tap, focus goes to the text input and TalkBack reads "edit box" followed by the text inside the input. Is this expected behaviour maybe?

Dominic Mazzoni

unread,
Apr 4, 2017, 5:37:25 PM4/4/17
to Eyes-free Programming and development
Yes, if the text box already has text entered. If the text box is empty, it reads the label associated with it.

There's no way currently to get the label for a text box after you've entered text, this is a known bug (originally designed that way on purpose, but now acknowledged that it should be improved)

Matt Anderson

unread,
Apr 5, 2017, 7:47:27 PM4/5/17
to Eyes-free Programming and development
Dominic, thanks for all the great feedback, it's been really helpful. I have things sorted out now.
Reply all
Reply to author
Forward
0 new messages