Skip to content

UX icons > aria-hidden=true despite aria-label defined #1796

Closed
@BigBenJr

Description

@BigBenJr

If I add aria-label attribute in svg file in /assets/icons

<svg xmlns="http://www.w3.org/2000/svg" width="3rem" height="3rem" viewBox="0 0 24 24" aria-label="Menu nav"><g fill="none"><path d="[...]"/></g></svg>

And display icon via twig

{{ ux_icon('mingcute:menu-fill') }}

The icon is rendered with aria-hidden="true".

<svg width="3rem" height="3rem" viewBox="0 0 24 24" aria-label="Menu nav" fill="currentColor" aria-hidden="true">

But I think the aria-hidden attribute should not be rendered as I defined aria-label in svg file.

I am compel to add aria-label via twig to disable aria-hidden.

{{ ux_icon('mingcute:menu-fill', {'aria-label': 'Menu nav'}) }}

<svg width="3rem" height="3rem" viewBox="0 0 24 24" aria-label="Menu nav" fill="currentColor">

Is it by design or is it a bug ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions