Keep focus on Provider select after Reset to default #532
Conversation
The Reset button disappears once settings are cleared because hasSavedSelection becomes false, leaving keyboard focus orphaned on the unmounted button. Move focus to the provider select before triggering clear() so focus stays within the form. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #532 +/- ##
==========================================
Coverage 70.07% 70.07%
Complexity 1107 1107
==========================================
Files 67 67
Lines 5367 5367
==========================================
Hits 3761 3761
Misses 1606 1606
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Fixed - Keep keyboard focus on the Provider select when resetting per-feature developer settings to default. Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: dkotter <dkotter@git.wordpress.org>

See #180 (comment)
What?
Why?
How?
DataFormin a ref-bearing<div>so we can locate the rendered Provider<select>. Unfortunately, the DataForm component itself does not support refs.accessibleWhenDisabledto the button so the focus target stays interactive while the save is in flight.DataFormitself is a plain function component (notforwardRef), and theFieldAPI has no ref hook for the underlying control, so wrapping with a ref +querySelectoris the least invasive option.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 4.7
Used for: Drafting the focus-management change and this PR description; reviewed and edited by me.
Testing Instructions
<select>.Screenshots or screencast
Recording.2026-05-10.001712.mp4
Changelog Entry