FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix: a11y Add focus again to Generate Title button on modal close by hbhalodia · Pull Request #644 · WordPress/ai · GitHub

/ ai Public

Fix: a11y Add focus again to Generate Title button on modal close - #644

Merged
dkotter merged 2 commits into
WordPress:developfrom
hbhalodia:fix/issue-589-3
Jun 2, 2026
Merged

Fix: a11y Add focus again to Generate Title button on modal close#644
dkotter merged 2 commits into
WordPress:developfrom
hbhalodia:fix/issue-589-3

Conversation

hbhalodia commented Jun 2, 2026
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Contributor

What?

Part of : #589

Why?

How?

  • Adds the ref to the button and restore the focus on modal close.
  • Also displays the container in which the button is placed, as it is hidden via JS.

Use of AI Tools

  • Claude Code, Opus 4.8
  • Used for initial research and to provide a fix for a11y.

Testing Instructions

  1. Open any post/page
  2. Make sure title generation experiment is active.
  3. Click on generate, once inserted the focus would be on generate again.

Screenshots or screencast

Screen.Recording.2026-06-02.at.2.22.28.PM.mov

Changelog Entry

Fixed - Fix a11y issue after generating title the focus was lost.

github-actions Bot commented Jun 2, 2026
edited
Loading

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: hbhalodia <hbhalodia@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

codecov Bot commented Jun 2, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.50%. Comparing base (6b36539) to head (0b09bbd).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #644   +/-   ##
==========================================
  Coverage      74.50%   74.50%           
  Complexity      1740     1740           
==========================================
  Files             85       85           
  Lines           7523     7523           
==========================================
  Hits            5605     5605           
  Misses          1918     1918           
Flag Coverage Δ
unit 74.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

dkotter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This works, as far as bringing focus back to the button but I think a better experience is to bring focus back to the title input, which should automatically trigger the showing of the button.

As an example, if I click Generate Title and then click somewhere else while the generation is happening (say into a paragraph block) the modal eventually shows and once I close out the modal, my cursor remains in the paragraph block but the generate button is showing, even though focus isn't in the title input. So I'd suggest we move focus/cursor back to the title input

Copy link
Copy Markdown
Contributor Author

Thanks @dkotter, This is now fixed in commit - 0b09bbd

dkotter merged commit 35be266 into WordPress:develop Jun 2, 2026
39 of 41 checks passed
jorgefilipecosta pushed a commit that referenced this pull request Jun 15, 2026
Fixed - Lost focus after generating a title.

Co-authored-by: hbhalodia <hbhalodia@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL