WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: does talkback should announce a UI control as a button

for

From: Jonathan Avila
Date: Jun 23, 2020 4:52PM


In relation to the accessibility delegate- if you set the role but don't update the className of the custom component these custom buttons won't show up in the item chooser for buttons -- changing the custom button's className in the AccessibilityNodeInfo object will allow that to work and have the role announced without having to set the role - so that would seem to be the preferred approach. If you look at the React Mobile accessiblity library they seem to set both.

Jonathan

-----Original Message-----
From: WebAIM-Forum < <EMAIL REMOVED> > On Behalf Of <EMAIL REMOVED>
Sent: Tuesday, June 23, 2020 6:19 PM
To: 'WebAIM Discussion List' < <EMAIL REMOVED> >
Subject: Re: [WebAIM] does talkback should announce a UI control as a button

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


For custom elements to provide a custom role you must use AccessibilityDelegateCompat (https://medium.com/android-microsoft/android-accessibility-resolving-common
-talkback-issues-3c45076bcdf6#d51f), but realize doing so you are taking over providing accessibility information for that element if something for that element is updated.

Better to user native elements for their specified purpose, when possible.

Android does need better support for roles and states in general IMO.

Also, TalkBack users can turn off roles if they really want to:
http://www.accessibility.io/images/Android_TalkBack_Verbosity_Element_Type.p
ng

Thankx,
Joe Humbert
Accessibility Champion
Android & iOS Accessibility Novice

-----Original Message-----
From: WebAIM-Forum < <EMAIL REMOVED> > On Behalf Of Birkir R. Gunnarsson
Sent: Tuesday, June 23, 2020 5:05 PM
To: WebAIM Discussion List < <EMAIL REMOVED> >
Subject: Re: [WebAIM] does talkback should announce a UI control as a button

If it's a native Android button it will be announced as a button.
If it is a custom element that acts like a button, yes, it needs to be announced as a button (all interactive elements should have the appropriate role, that is a WCAG 4.1.2 requirement that applies just as much on mobile apps as it does to web).
I have a code snippet that assigns a button role to a custom Android component, but I have to dig it up.


On 6/23/20, Laura Fathauer < <EMAIL REMOVED> > wrote:
> I don't know about the programming aspect of it; but yes, TalkBack
> should still be able to announce to a user what the role of an element
> is. Otherwise the user either won't know that the element is
> interactive, or if, it it has an incorrect role, they won't know the
> proper interaction.
>
> Laura
>
> On Tue, Jun 23, 2020 at 7:16 AM konstantin galiakhmetov
> < <EMAIL REMOVED> > wrote:
>>
>> Hello all.
>>
>> i can not understand how talkback should announce custom controls.?
>>
>> For example when i am testing web page i am sure that a custom button
>> implemented using <div> must have the role attribute and must be
>> announced as a button but when i am testing a native android
>> application i am doubting. If We have a custom button that is
>> inherited a simple view talkback does announce this control as a
>> button and i do not know it is bug or no.
>>
>>
>> sincerely Konstantin.
>>
>> >> >> archives at http://webaim.org/discussion/archives
>> > > > archives at http://webaim.org/discussion/archives
> >


--
Work hard. Have fun. Make history.