ic-ui-kit icon indicating copy to clipboard operation
ic-ui-kit copied to clipboard

Internal issue 3030 - Aria-label on ic-status-tag overrides aria-label on parent component

Open ticket-sync[bot] opened this issue 8 months ago • 1 comments

I have a component that wraps an ic-status-tag and is used inside a named container. I would like to add an aria-label to the component so that a screen reader will read out the name of the container, then the status of the ic-status-tag (using role=status via the announced prop). Currently, the screen reader prioritises the aria-label set inside the host of the ic-status-tag: “Status”, and will read “Status status good” for example. When there are multiple containers with different names with changing statuses, the screen reads “Status status good” for all of them. If the aria-label is removed from the ic-status-tag host, (tested with the browser devTools) it should read “'Container Name' status good” which is the desired behaviour.

  <my-status-tag-wrapper aria-label=”container name”>

    ..Good..

 

Is it possible to remove the aria-label=“Status” from the ic-status-tag :-<Host role= {announced ? "status" : null} aria-label="Status">,

or maybe add a prop so that the desired aria-label can be passed in, e.g. : <Host role= {announced ? "status" : null} aria-label={customAria ?? "Status">

ticket-sync[bot] avatar Apr 29 '25 09:04 ticket-sync[bot]

Add functionality to add a custom aria label

MI6-255 avatar May 07 '25 08:05 MI6-255

it might be more consistent with other components to use "aria-label" attribute directly rather than adding a new "customAria" prop. would need to think about how to handle change to the attribute though eg by adding a mutationObserver to watch for changes to the attribute

ad9242 avatar Aug 26 '25 16:08 ad9242