WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Icon-only buttons

for

From: Geethavani.Shamanna
Date: Jan 24, 2022 7:55AM


Thanks Alan for these useful suggestions.

More than the modified count being announced immediately, the reason I want the alt text to reflect the count is to enable users, when viewing the page, to right away have access to the count on encountering the image. For example, if there are 55 comments, a user gets that information without having to arrow up or down to find out the exact number of comments.

Geetha
-----Original Message-----
From: Alan Zaitchik < <EMAIL REMOVED> >
Sent: 21 January 2022 03:28
To: Geethavani.Shamanna < <EMAIL REMOVED> >
Cc: WebAIM Discussion List < <EMAIL REMOVED> >
Subject: Re: [WebAIM] [EXTERNAL] Re: Icon-only buttons

CAUTION: This mail comes from outside the University. Please consider this before opening attachments, clicking links, or acting on the content.

Geetha,
I don’t know if you care to notify the user of a change the user himself/herself might make by liking or commenting or whatever, but if so you could use aria-labelledby and point to a counter that is in a “polite” live area, visible or off-screen. So if the user clicks a like icon and changes the counter, from 100 to 101, say, they would hear that there are now 101 likes as a sort of confirmation message. I think it’s always good to communicate status or result of a button action in a case like this. There is no detectable feedback from just changing ALT text.
The above suggestion would not be good if the count can be changed asynchronously by external events not triggered by the user, and it would not even be relevant if the counts were just set on page load and not subject to change at all.
But even in those cases, I might still prefer to use aria-labelledby ( without the aria-live.) Although I won’t try to strongly defend the following “feeling”, I think it’s a better coding practice to update a text node than an an attribute like ALT. This consideration would apply even if the icons are read only for the use case you have in mind.

A

> On Jan 20, 2022, at 08:53, Geethavani.Shamanna < <EMAIL REMOVED> > wrote:
>
> Interesting. Should icons be presented as buttons even if they are not interactive?
>
> Also, I am currently testing a web page that contains icons titled 'Contribution-Count-Icon', 'Like-Count-Icon', and so on. The developers have conveniently used the original name of the icon in the alt text. Above each of these icons there are numbers such as 0, 58, and so on, based on the number of likes or comments. It would be ideal if the alt text for these icons can also reflect this number. For example, 'Number of likes: 58'. However, since the number is dynamic, what is the best way to incorporate this into the alt text? Finally, should these icons be presented as buttons, although they cannot be clicked on?
>
> Many thanks.
> Geetha