Skip to content

DataViews list layout: row children include interactive elements outside gridcell wrappers #78982

Closed

Description

@hi0001234d

Description

In the DataViews list layout (used on Site Editor → Pages, Templates, Template Parts, Patterns, etc.), each row is rendered with role="row". However, the title field, description, and other field cells inside the row are not wrapped in any element with role="gridcell" their interactive children (title link, inline action buttons) appear as direct accessibility-tree descendants of role="row".

Per WAI-ARIA, an element with role="row" is restricted to children with role="gridcell", rowheader, or columnheader. Allowing arbitrary interactive elements breaks the grid pattern, prevents assistive technologies from conveying cell structure, and fails the aria-required-children check (WCAG 1.3.1, Info and Relationships).

The selectable item button and the actions menu inside the same row are already correctly wrapped in <div role="gridcell"> the title/description/fields section appears to have missed the same treatment.

*Element: .dataviews-view-list .dataviews-title-field, .dataviews-view-list__field (rendered inside <div role="row"> without gridcell wrappers)

Current structure (simplified):

<div role="row">
  <div role="gridcell"><button>…selectable item…</button></div>
  <div>
    <div class="dataviews-title-field">
      <a href="…">Title</a>          <!-- direct child of row -->
      <button>Delete</button>         <!-- direct child of row -->
    </div>
    <div class="dataviews-view-list__field">…description…</div>
    <div class="dataviews-view-list__field">…field value…</div>
  </div>
</div>

Proposed fix

I have a working fix ready for this issue it adds role="gridcell" to the title field, description, and per-field wrappers inside the row, so all interactive content has a valid gridcell parent. The change is purely an ARIA attribute addition; no DOM structure or styling is modified. I can share a brief outline or open a PR once the approach is confirmed.

Before fix applied

Image

After fix applied

Image

Expected behaviour

All interactive content inside role="row" should be contained within role="gridcell" (or rowheader/columnheader) wrappers, consistent with the existing handling of the selectable item button and actions menu.

Step-by-step reproduction instructions

Step-by-step reproduction instructions

  1. Open Site Editor → Pages* (admin.php?page=site-editor-v2&p=%2Ftypes%2Fpage).
  2. Switch to List layout.
  3. Inspect any row in DevTools.
  4. Observe the <div role="row"> node its descendants include an <a> link and a <button> that are not contained within a <div role="gridcell">.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. added
    [Type] BugAn existing feature does not function as intended
    on Jun 5, 2026
  2. added
    [Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond
    on Jun 8, 2026
  3. ntsekouras commented on Jun 15, 2026

    @ntsekouras
    Contributor

    Current structure (simplified): ...

    Thanks for the issue! I'm not sure the structure you shared is what is rendered in trunk.. The actions are already wrapped in role:gridcell and the titles don't render an a element.

    With the current output in trunk, I'm not sure there is any change needed. Am I missing something?

  4. hi0001234d commented on Jun 15, 2026

    @hi0001234d
    ContributorAuthor

    You're right, @ntsekouras I just pulled latest trunk and rebuilt, and the title field now renders as <span> instead of <a>, with the inline "View" and actions both already wrapped in gridcell. The original interactive children outside gridcell that I observed during investigation appear to have been resolved.

    I'll close this PR. Thanks for the careful review.

  5. ntsekouras commented on Aug 26, 2026

    @ntsekouras
    Contributor

    Closing as the report doesn't exist in trunk, also verified by the author above. Thanks.

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

Metadata

Metadata

Assignees

Labels

[Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions