Skip to content

Conversation

@xovnsi
Copy link
Contributor

@xovnsi xovnsi commented Nov 4, 2025

Description

This PR unsets the role of sign in link, which is currently a "button" in order to fix this a11y issue: https://zendesk.atlassian.net/browse/GA11YFIX-448

Screenshots

Before:
image

After:
image

Checklist

  • 📗 all commit messages follow the conventional commits standard
  • ⬅️ changes are compatible with RTL direction
  • ♿ Changes to the UI are tested for accessibility and compliant with WCAG 2.1.
  • 📝 changes are tested in Chrome, Firefox, Safari and Edge
  • 📱 changes are responsive and tested in mobile
  • 👍 PR is approved by @zendesk/vikings

@xovnsi xovnsi changed the title style: add empty role [a11y] Override button role for a link Nov 6, 2025
@xovnsi xovnsi marked this pull request as ready for review November 6, 2025 12:04
@xovnsi xovnsi requested a review from a team as a code owner November 6, 2025 12:04
@xovnsi xovnsi requested a review from a team November 6, 2025 12:06
Copy link
Contributor

@Fredx87 Fredx87 left a comment

Choose a reason for hiding this comment

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

The style commit type is not the correct type for these type of changes

  • it should be used for "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)"
  • It is not going to create a new version when the PR is merged
  • It is not going to add an entry in the changelog
  • the correct type is fix

@xovnsi xovnsi force-pushed the malgorzata/a11y-sing-in-role branch from 008f253 to d5213e6 Compare November 6, 2025 12:29
@xovnsi xovnsi force-pushed the malgorzata/a11y-sing-in-role branch from d5213e6 to 44ed9a3 Compare November 6, 2025 12:30
@xovnsi xovnsi requested a review from Fredx87 November 6, 2025 12:31
{{#unless signed_in}}
<li>
{{#link "sign_in" class="sign-in"}}
{{#link "sign_in" class="sign-in" role=""}}
Copy link
Contributor

Choose a reason for hiding this comment

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

This fix is going to assign an empty role to the element. I am not sure it is ok for a11y, let's see what @zendesk/product-accessibility says. I understand we cannot just remove the role from Help Center since it can cause breaking changes, but maybe we should set it explicitly to the default role for links (which I guess is link).

We also need to update the link in the mobile view:

{{#link "sign_in"}}

And we should probably also remove the title from Help Center that says "Opens a dialog", since it is not true anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, I tested this change and the role was a "link", but maybe it's better to say it explicitly

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, VoiceOver reads it as a link even if in the HTML there is role="". I am not sure about other screen readers

Copy link
Contributor

@jgorfine-zendesk jgorfine-zendesk Nov 6, 2025

Choose a reason for hiding this comment

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

Hey @xovnsi & @Fredx87, I'm a little confused about why having VoiceOver announce the link as a link is a bad thing. Isn't that the outcome we want, in resolving this ticket? 👀

I'm also confused because the screenshot in the PR description is showing that the HTML element being rendered is an <a>, which already has role="link" baked into it. We'd have to apply role="button" to the element explicitly, in order to change its role. Where/how is that happening? I'd imagine the change would need to happen at that level. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @jgorfine-zendesk,
For some reason we have it set up in help center: https://github.com/zendesk/help_center/pull/32599
and setting role in Copenhagen Theme to "" will override the button role to the link role.
We can't change the role in help center, because some other themes may rely on the button role.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @xovnsi, thanks for the additional details. In that case, I think it'd be best if, like @Fredx87 said, we set the role to link explicitly.

Suggested change
{{#link "sign_in" class="sign-in" role=""}}
{{#link "sign_in" class="sign-in" role="link"}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants