Skip to content

Keep buttons steady on focus and align the 404 search form - #92

Open
henriqueiamarino wants to merge 2 commits into
trunkfrom
fix/search-form-shift
Open

henriqueiamarino wants to merge 2 commits into
trunkfrom
fix/search-form-shift

Conversation

@henriqueiamarino

@henriqueiamarino henriqueiamarino commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #90.

Two commits, both from @carolinan's report:

  1. The layout shift — reproduced and pinned down: styles.elements.button declared a 1px dotted border on its focus states while the resting button has no border. WordPress only emits border/outline for the :focus-visible pseudo (the :focus rule emits colors alone), which is why the shift appears on keyboard focus and click-focus in browsers that promote it — matching the 'mouse and keyboard' repro steps. Measured on trunk: tabbing to the search button grows it 47→49px and the input stretches with it. The dotted focus signal now lives on the outline — dotted 1px at the existing 4px offset, in the ink color — which never affects layout. Measured on this branch under the same keyboard focus: dotted ring renders, border stays 0, shift is 0. The Button block's dotted focus border is untouched; it is metric-safe there because that block's resting state already carries a 1px border.

  2. Form parity: the 404 template's search block now matches the search results form — placeholder and button-inside layout — answering the question raised in the issue. (Design change made by @henriqueiamarino in the editor, merged to the pattern.)

🤖 Generated with Claude Code

henriqueiamarino and others added 2 commits September 22, 2026 19:29
The button element gained a 1px dotted border on focus that its resting
state never had, so every focused button grew two pixels and the search
input stretched with it. The dotted focus signal moves to the outline,
which never affects layout, with the ink color so the ring reads on the
page ground. The Button block keeps its dotted focus border, which is
safe there: its resting state already carries a border of the same width.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Same placeholder, same button-inside layout — the two forms should not
differ.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added [Area] Global Styles Issues or PRs that touch theme.json or the base stylesheet. [Area] Patterns Issues or PRs that touch the theme's block patterns. labels Sep 22, 2026
@github-actions

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: henriqueiamarino <iamarinoh@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>

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

@carolinan carolinan assigned carolinan and unassigned carolinan Sep 23, 2026
@carolinan
carolinan self-requested a review September 23, 2026 09:57
@carolinan

carolinan commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Screenshots after the change

Submit button with focus
image

Search block with button inside, and the focus is on the button
image

Small problem here due to the lack of spacing

With button only, the focus is on the button: Focus is only visible on one side.
image

With button only, once the button has been activated so that the search field shows, and the focus is on the button: There is an overlap with the input element:
image
For example, when the search bar is activated and the focus is on the button:
image

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

Labels

[Area] Global Styles Issues or PRs that touch theme.json or the base stylesheet. [Area] Patterns Issues or PRs that touch the theme's block patterns.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slight layout shift when the search form button is focused or active

2 participants