Repository navigation
Block Mover: Fix clipped focus ring - #86857
Conversation
The toolbar now draws its focus ring with an offset outline on the button's ::before. The block mover and drag handle buttons clip their overflow, so the ring was cut off and only its corners remained. Draw the ring without an offset for these buttons so it fits inside. Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URw1rqvJyd3rrDFo5ST
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +55 B (0%) Total Size: 8.65 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Actions are reachable via RIGHT/LEFT arrow keys (Site Editor v2) in
|
Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URw1rqvJyd3rrDFo5ST
The drag handle icon fits inside the button, so clipping is not needed and the standard offset focus ring can be shown as is. Keep the zero-offset ring only for the move buttons, which need overflow: hidden to keep their icons from overlapping each other's click area. Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URw1rqvJyd3rrDFo5ST
|
Thanks for the review! |
Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org>
What?
Fixes the focus ring of the block mover buttons (move up/down) and the drag handle in the block toolbar, which is cut off so that only its corners are visible.
Why?
#84573 changed the toolbar's focus ring from a box-shadow to the design system's outline with an offset, drawn on the button's
::before. The ring now extends 4px beyond::before, but the block mover and drag handle buttons haveoverflow: hiddenand only leave 2px of space around::before, so the ring gets clipped.How?
overflow: hidden, which was added in Clean BlockMover component and styles #40379 when the drag handle was narrowed to 24px. Its icon fits inside the button, so removing it should cause no problem: it changes neither the appearance nor the clickable area, and the standard focus ring can be shown as is.overflow: hidden, which was added in Fix block mover clickable area #67261 to prevent their icons from overlapping each other's clickable area. Instead, setoutline-offset: 0on the focused::before.Testing Instructions
Use of AI Tools
This PR was investigated and authored with Claude Code, and reviewed by me.