Skip to content

Add role attribute to PostStream item for accessibility#4780

Open
claudiushenrichs wants to merge 1 commit into
flarum:2.xfrom
claudiushenrichs:ch/PostStream-a11y
Open

Add role attribute to PostStream item for accessibility#4780
claudiushenrichs wants to merge 1 commit into
flarum:2.xfrom
claudiushenrichs:ch/PostStream-a11y

Conversation

@claudiushenrichs

Copy link
Copy Markdown
Contributor

Changes proposed in this pull request:
The PostStream document structure of a discussion is currently failing the "Elements with an ARIA [role] that require children to contain a specific [role] are missing some or all of those required children." accessibility test. The parent PostStream

container has the "feed" ARIA role which requires children to have the "article ARIA role.
This pull request adds role="article" attribute to the PostStream-item.

Reviewers should focus on:
A few lines further down in PostStream.js (around line 92) there is another reference to a container with classes "className="PostStream-item PostStream-afterFirstPost"" - I haven't figured out under which circumstances this container gets inserted, but it might also require the role=article. If anyone can shed some light on whether this is also a child within the PostStream feed parent container.

Screenshot
image

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered? - article ARIA role is the only one allowed per documentation. Semantically more correct would be something like role="comment", but whom am I to judge.
  • 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.

@claudiushenrichs claudiushenrichs requested a review from a team as a code owner June 25, 2026 13:47
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.

1 participant