Skip to content

[WIP] Fix modal close button accessibility issues#2827

Merged
Soare-Robert-Daniel merged 4 commits into
developmentfrom
codex/fix-modal-close-button-a11y
Jun 23, 2026
Merged

[WIP] Fix modal close button accessibility issues#2827
Soare-Robert-Daniel merged 4 commits into
developmentfrom
codex/fix-modal-close-button-a11y

Conversation

@Codex

@Codex Codex AI commented May 27, 2026

Copy link
Copy Markdown

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>Modal close button not a11y ready</issue_title>
<issue_description>Reported: https://secure.helpscout.net/conversation/3130832256/475624

The Close button of Modal block lacks aria-labels and others to help users with screen-readers.</issue_description>

Comments on the Issue (you are @codex[agent] in this section)

Co-authored-by: Soare-Robert-Daniel <17597852+Soare-Robert-Daniel@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves accessibility for Modal/Popup close buttons by adding accessible labels in editor and frontend/server-rendered markup.

Changes:

  • Adds labels/tooltips to editor close buttons for free Popup and Pro Modal blocks.
  • Adds aria-label, title, and screen-reader text to frontend close button markup.
  • Adds an E2E test asserting the frontend close button has an aria-label.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/pro/blocks/modal/edit.js Adds an accessible label and tooltip to the Pro Modal editor close button.
src/blocks/test/e2e/blocks/modal.spec.js Adds coverage for close button aria-label and close behavior.
src/blocks/blocks/popup/save.js Updates saved Popup close button markup with accessible labeling.
src/blocks/blocks/popup/edit.js Adds an accessible label and tooltip to the Popup editor close button.
plugins/otter-pro/inc/render/class-modal-block.php Adds accessible labeling to the server-rendered Pro Modal close button.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +41 to +48
<button
type="button"
className="components-button has-icon"
aria-label={ __( 'Close', 'otter-blocks' ) }
title={ __( 'Close', 'otter-blocks' ) }
>
<span className="screen-reader-text">{ __( 'Close', 'otter-blocks' ) }</span>
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true"><path d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"></path></svg>
@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review May 28, 2026 11:21
@pirate-bot

pirate-bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 178.27 KB 178.27 KB 0 B (0.00%)
Blocks 1.52 MB 1.52 MB 1.63 KB (0.10%)
CSS 7.87 KB 7.87 KB 0 B (0.00%)
Dashboard 111.06 KB 111.06 KB 0 B (0.00%)
Onboarding 68.14 KB 68.14 KB 0 B (0.00%)
Export Import 4.7 KB 4.7 KB 0 B (0.00%)
Pro 328.43 KB 328.48 KB 51 B (0.02%)

@pirate-bot

pirate-bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Plugin build for e78a8cb is ready 🛎️!

@pirate-bot

pirate-bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

E2E Tests

Playwright Test Status: See serial and parallel matrix jobs

Performance Results serverResponse: {"q25":479.1,"q50":511.05,"q75":520.2,"cnt":10}, firstPaint: {"q25":598.6,"q50":626.25,"q75":684.6,"cnt":10}, domContentLoaded: {"q25":3503.1,"q50":3554.3,"q75":3566.5,"cnt":10}, loaded: {"q25":3505.2,"q50":3556.25,"q75":3568.5,"cnt":10}, firstContentfulPaint: {"q25":4065.7,"q50":4129.6,"q75":4140.6,"cnt":10}, firstBlock: {"q25":14190.6,"q50":14302.9,"q75":14498.8,"cnt":10}, type: {"q25":23.77,"q50":24.37,"q75":25.2,"cnt":10}, typeWithoutInspector: {"q25":19.73,"q50":20.6,"q75":21.89,"cnt":10}, typeWithTopToolbar: {"q25":29.44,"q50":30.46,"q75":33.01,"cnt":10}, typeContainer: {"q25":13.42,"q50":14.41,"q75":15.82,"cnt":10}, focus: {"q25":112.08,"q50":116.4,"q75":119.89,"cnt":10}, inserterOpen: {"q25":37.38,"q50":37.65,"q75":39.55,"cnt":10}, inserterSearch: {"q25":12.34,"q50":12.8,"q75":13.29,"cnt":10}, inserterHover: {"q25":5.15,"q50":5.4,"q75":5.69,"cnt":20}, loadPatterns: {"q25":1580.09,"q50":1595.62,"q75":1701.35,"cnt":10}, listViewOpen: {"q25":219.51,"q50":235.25,"q75":245.72,"cnt":10}

Soare-Robert-Daniel and others added 2 commits June 18, 2026 17:16
Strengthen the modal e2e to assert the close button's accessible name
(aria-label/title/screen-reader-text, aria-hidden icon) and keyboard
operability, and add matching coverage for the popup block.

Add a deprecation for the prior `title="Close Button"` popup markup so
popups saved before the a11y change keep validating after save.js
switched to aria-label + screen-reader-text.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Soare-Robert-Daniel Soare-Robert-Daniel merged commit 51b0cb9 into development Jun 23, 2026
14 of 17 checks passed
@Soare-Robert-Daniel Soare-Robert-Daniel deleted the codex/fix-modal-close-button-a11y branch June 23, 2026 11:21
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.

Modal close button not a11y ready

4 participants