Skip to content

♿️(frontend) add aria-hidden to decorative icons in dropdown menu#2093

Merged
Ovgodd merged 1 commit intomainfrom
fix/more-optns-decorative-icons
Mar 25, 2026
Merged

♿️(frontend) add aria-hidden to decorative icons in dropdown menu#2093
Ovgodd merged 1 commit intomainfrom
fix/more-optns-decorative-icons

Conversation

@Ovgodd
Copy link
Collaborator

@Ovgodd Ovgodd commented Mar 20, 2026

Description

Add aria-hidden to decorative SVG icons in the dropdown menu so they are ignored by assistive technologies. ( NVDA / VO )

Proposal

  • Add aria-hidden and focusable="false" to custom SVG icons rendered in DropdownMenu options
  • Extract icon rendering logic into a customIconElement constant for clarity

@Ovgodd Ovgodd requested a review from AntoLC March 20, 2026 11:17
@Ovgodd Ovgodd self-assigned this Mar 20, 2026
@github-actions
Copy link

github-actions bot commented Mar 20, 2026

Size Change: +9 B (0%)

Total Size: 4.24 MB

Filename Size Change
apps/impress/out/_next/static/1160463c/_buildManifest.js 622 B +622 B (new file) 🆕
apps/impress/out/_next/static/b650f143/_buildManifest.js 0 B -622 B (removed) 🏆

compressed-size-action

@Ovgodd Ovgodd force-pushed the fix/more-optns-decorative-icons branch from d89bd67 to eb43bae Compare March 20, 2026 11:54
@Ovgodd Ovgodd moved this from Backlog to In review in LaSuite Docs A11y Mar 20, 2026
@Ovgodd Ovgodd moved this from In review to In progress in LaSuite Docs A11y Mar 20, 2026
@Ovgodd Ovgodd linked an issue Mar 20, 2026 that may be closed by this pull request
@Ovgodd Ovgodd marked this pull request as ready for review March 20, 2026 11:55
@Ovgodd Ovgodd moved this from In progress to In review in LaSuite Docs A11y Mar 20, 2026
@Ovgodd Ovgodd force-pushed the fix/more-optns-decorative-icons branch from eb43bae to 79d362e Compare March 20, 2026 16:50
<Box
$theme="neutral"
$variation={isDisabled ? 'tertiary' : 'primary'}
aria-hidden="true"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You add aria-hidden="true" here, is it necessary to add it on the icon as well ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You add aria-hidden="true" here, is it necessary to add it on the icon as well ?

Yes you are right, the aria-hidden on the Box alone would work, but putting it directly on each icon is cleaner (and respect RGAA rules ),
it's explicit about what we're hiding and why.
If someone refactors the layout later, the icons stay hidden.
But I I've removed it from the Box to avoid redundancy.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but in every rerender we are recloning a element, to add a aria that is not totally necessary, so I am mitigate about this code snippet. Is it not cleaner so to add the aria-hidden directly on the icon when it is used ?

@Ovgodd Ovgodd requested a review from AntoLC March 24, 2026 10:45
Comment on lines +188 to +199
const customIconElement =
option.icon && typeof option.icon !== 'string'
? isValidElement(option.icon)
? cloneElement(
option.icon as ReactElement<{
'aria-hidden'?: boolean;
}>,
{ 'aria-hidden': true },
)
: option.icon
: null;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this snippet, comment here: #2093 (comment)

I think we should either, let the Box forcing the aria-hidden (parent level), or adding it to the icon directly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey !

Yes, adding it to the icon directly is a good compromise, I agree! I've updated all SVG icons in DocsGridActions and DocToolBox with aria-hidden="true", and removed the cloneElement logic from DropdownMenu.

@Ovgodd Ovgodd requested a review from AntoLC March 25, 2026 08:37
@Ovgodd Ovgodd force-pushed the fix/more-optns-decorative-icons branch 3 times, most recently from 5bfb21a to c5ce738 Compare March 25, 2026 11:50
@Ovgodd Ovgodd force-pushed the fix/more-optns-decorative-icons branch from c5ce738 to b8e1d12 Compare March 25, 2026 13:15
@Ovgodd Ovgodd merged commit b8e1d12 into main Mar 25, 2026
26 of 27 checks passed
@Ovgodd Ovgodd deleted the fix/more-optns-decorative-icons branch March 25, 2026 13:53
@github-project-automation github-project-automation bot moved this from In review to Done in LaSuite Docs A11y Mar 25, 2026
lunika added a commit that referenced this pull request Mar 25, 2026
Added

- 🚸(frontend) hint min char search users #2064

Changed

- 💄(frontend) improve comments highlights #1961
- ♿️(frontend) improve BoxButton a11y and native button semantics #2103
- ♿️(frontend) improve language picker accessibility #2069
- ♿️(frontend) add aria-hidden to decorative icons in dropdown menu #2093

Fixed

- 🐛(y-provider) destroy Y.Doc instances after each convert request #2129
- 🐛(backend) remove deleted sub documents in favorite_list endpoint #2083
lunika added a commit that referenced this pull request Mar 25, 2026
Added

- 🚸(frontend) hint min char search users #2064

Changed

- 💄(frontend) improve comments highlights #1961
- ♿️(frontend) improve BoxButton a11y and native button semantics #2103
- ♿️(frontend) improve language picker accessibility #2069
- ♿️(frontend) add aria-hidden to decorative icons in dropdown menu #2093

Fixed

- 🐛(y-provider) destroy Y.Doc instances after each convert request #2129
- 🐛(backend) remove deleted sub documents in favorite_list endpoint #2083
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

More options menu: Decorative icons

2 participants