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: use feed aria role for DiscussionList #3359

Merged
merged 4 commits into from
Mar 28, 2022
Merged

a11y: use feed aria role for DiscussionList #3359

merged 4 commits into from
Mar 28, 2022

Conversation

davwheat
Copy link
Member

@davwheat davwheat commented Mar 28, 2022

FIxes #3363

Changes proposed in this pull request:

  • Uses role=feed on discussion list

Reference: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/feed_role

If the number of articles is known, set aria-setsize on the articles themselves. However, if the total number is extremely large, indefinite, or changes often, set aria-setsize="-1" to indicate that the size of the feed is not known.

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

Required changes:

  • Related documentation PR: (Remove if irrelevant)
  • Related core extension PRs: (Remove if irrelevant)

@davwheat davwheat added the type/accessibility Issues relating to accessibility (keyboard navigation, screenreaders, text contrast, etc.) label Mar 28, 2022
@davwheat davwheat self-assigned this Mar 28, 2022
@davwheat davwheat marked this pull request as ready for review March 28, 2022 12:38
return pg.items.map((discussion) => (
<li key={discussion.id()} data-id={discussion.id()}>
{DiscussionListItem.component({ discussion, params })}
<div class={classList('DiscussionList', { 'DiscussionList--searchResults': state.isSearchResults() })}>
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we still use className?

Copy link
Member Author

Choose a reason for hiding this comment

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

It makes no difference in Mithril, and newer stuff we've been doing has been using class, or supporting passing either to components (see the Button TS rewrite).

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.

[A11Y] Apply role="feed" to post/discussion streams
3 participants