Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[A11Y] Explicitly state aria-hidden value; hide icons from screenreaders #3027

Merged
merged 2 commits into from
Aug 15, 2021

Conversation

davwheat
Copy link
Member

Changes proposed in this pull request:

  • Explicitly state the value of aria-hidden (needed for Talkback on Android)
  • Hide icons from screenreaders as these are purely visual elements

Reviewers should focus on:

🤷

Confirmed

  • Frontend changes: tested on a local Flarum installation.
    • tested on Android 11

@davwheat davwheat added the type/accessibility Issues relating to accessibility (keyboard navigation, screenreaders, text contrast, etc.) label Aug 15, 2021
@davwheat davwheat self-assigned this Aug 15, 2021
Copy link
Sponsor Member

@askvortsov1 askvortsov1 left a comment

Choose a reason for hiding this comment

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

The string value suffices and we don't need a raw boolean, right?

EDIT: Actually, I think I would prefer using a boolean regardless. It's a bit more explicit as to the intended meaning.

@davwheat
Copy link
Member Author

Sure. Mithril converts the boolean to a string when rendering to the DOM, but both ways are fine. I think the boolean might actually be slightly smaller in terms of JS bundle :P

@davwheat
Copy link
Member Author

Actually it seems this will not work. Mithril converts the true boolean into an empty attribute value as opposed to the string "true", meaning this doesn't fix aria-hidden on Android.

Copy link
Sponsor Member

@askvortsov1 askvortsov1 left a comment

Choose a reason for hiding this comment

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

Fair enough. Maybe we should open an issue with Mithril?

@davwheat
Copy link
Member Author

No, its intended behaviour.

That way you can set an attribute depending on a conditional, like checked={this.state.checked}.

@davwheat davwheat merged commit afc1a1b into master Aug 15, 2021
@davwheat davwheat deleted the dw/explicit-aria-hidden branch August 15, 2021 18:54
@SychO9 SychO9 added this to the 1.1 milestone Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/accessibility Issues relating to accessibility (keyboard navigation, screenreaders, text contrast, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants