Skip to content

Block Mover: Fix clipped focus ring - #86857

Merged
ntsekouras merged 3 commits into
trunkfrom
fix/block-mover-focus-ring
Nov 16, 2026
Merged

ntsekouras merged 3 commits into
trunkfrom
fix/block-mover-focus-ring

Conversation

@t-hamano

@t-hamano t-hamano commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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.

before-after (2)

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 have overflow: hidden and only leave 2px of space around ::before, so the ring gets clipped.

How?

  • Drag handle: Remove 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.
  • Move up/down buttons: Keep overflow: hidden, which was added in Fix block mover clickable area #67261 to prevent their icons from overlapping each other's clickable area. Instead, set outline-offset: 0 on the focused ::before.

Testing Instructions

  1. Open the post editor and insert two paragraphs.
  2. Select one of them and move focus to the block mover buttons and the drag handle in the block toolbar.
  3. Confirm the focus ring is fully visible.
  4. Click the lower part of the move up button and confirm the block moves up, not down.

Use of AI Tools

This PR was investigated and authored with Claude Code, and reviewed by me.

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
@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Package] Block editor /packages/block-editor labels Nov 15, 2026
@t-hamano t-hamano self-assigned this Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

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: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: +55 B (0%)

Total Size: 8.65 MB

📦 View Changed
Filename Size Change
build/styles/block-editor/style-rtl.css 20.1 kB +15 B (+0.07%)
build/styles/block-editor/style-rtl.min.css 17.1 kB +13 B (+0.08%)
build/styles/block-editor/style.css 20.1 kB +15 B (+0.07%)
build/styles/block-editor/style.min.css 17.1 kB +12 B (+0.07%)

b7e7e12 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric a7dd016 trunk % Change
timeToFirstByte 56.6 ms +4.86% -3.8% 55.5 ms +5.86% -3.24% 1.98%
largestContentfulPaint 88 ms +4.55% -4.55% 84 ms +14.29% -2.38% 4.76%
lcpMinusTtfb 29.2 ms +14.38% -4.62% 29.25 ms +18.63% -5.3% -0.17%
wpBeforeTemplate 29.74 ms +9.11% -3.83% 28.99 ms +10.87% -2% 2.59%
wpTemplate 22.34 ms +3.67% -5.24% 22.28 ms +3.37% -4.04% 0.27%
wpTotal 52.72 ms +4.67% -4.08% 52 ms +4.48% -3.75% 1.38%
wpMemoryUsage 7.75 MB +0% -0% 7.71 MB +0% -0% 0.46%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric a7dd016 trunk % Change
timeToFirstByte 46.75 ms +5.35% -2.78% 47.1 ms +4.56% -3.08% -0.74%
largestContentfulPaint 84 ms +0% -4.76% 84 ms +2.38% -4.76% 0%
lcpMinusTtfb 34.9 ms +2.72% -2.29% 35 ms +4.14% -2.43% -0.29%
wpBeforeTemplate 26.45 ms +7.52% -1.17% 26.72 ms +6.85% -3.14% -1.01%
wpTemplate 16.66 ms +2.46% -4.08% 16.74 ms +4.3% -4.6% -0.48%
wpTotal 43.55 ms +5.76% -2.82% 43.78 ms +5.03% -2.67% -0.53%
wpMemoryUsage 6.44 MB +0% -0% 6.40 MB +0% -0% 0.57%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric a7dd016 trunk % Change
mediaProcessingJpeg 400.7 ms +2.29% -0.74% 401.22 ms +1.45% -0.46% -0.13%
mediaProcessingAvif 6144.12 ms +0.17% -0.08% 6169.91 ms +0.08% -0.16% -0.42%
mediaProcessingJpegToAvif 4228.24 ms +0.3% -0.04% 4257.25 ms +0.52% -0.18% -0.68%

media-upload

Metric a7dd016 trunk % Change
jpegUploadProcessing 1757.4 ms +14.64% -14.17% 1532.36 ms +26.99% -0.82% 14.69%
pngUploadProcessing 274.56 ms +7.54% -2.41% 273.4 ms +2.28% -0.84% 0.42%
largeJpegUploadProcessing 1504.58 ms +1.59% -1.15% 1948.27 ms +2.25% -23.18% -22.77%
multipleImageUploadProcessing 2064.77 ms +1.23% -1.01% 2069.74 ms +0.6% -0.63% -0.24%

post-editor

Metric a7dd016 trunk % Change
serverResponse 494.59 ms +0.81% -6.36% 490.8 ms +0.56% -6.71% 0.77%
firstPaint 435.21 ms +7.58% -10.02% 419.28 ms +8.29% -4.63% 3.8%
domContentLoaded 826.35 ms +3.27% -1.87% 815.67 ms +1.27% -1.5% 1.31%
loaded 827.6 ms +3.26% -1.87% 816.68 ms +1.26% -1.48% 1.34%
firstContentfulPaint 467.5 ms +4.45% -1.49% 466.53 ms +2.02% -2.68% 0.21%
firstBlock 2228.81 ms +5.66% -2.02% 2187.37 ms +1.48% -0.28% 1.89%
type 17.19 ms +6.05% -9.37% 17.23 ms +3.66% -8.47% -0.23%
typeWithoutInspector 17.23 ms +5.86% -5.63% 18.06 ms +7.25% -5.7% -4.6%
typeWithTopToolbar 22.3 ms +7.85% -9.1% 22.05 ms +14.88% -8.48% 1.13%
typeContainer 8.15 ms +5.89% -13.87% 8.29 ms +11.7% -14.11% -1.69%
focus 118.88 ms +5.91% -8.14% 123.75 ms +5.41% -8.02% -3.94%
firstFocus 279.47 ms +0% -0% 265.67 ms +0% -0% 5.19%
selectAll 426.87 ms +0.02% -2.98% 407.19 ms +8.18% -2.28% 4.83%
undo 28.1 ms +9% -3.56% 30.1 ms +11.63% -8.47% -6.64%
listViewOpen 81.86 ms +5.66% -2.17% 77.04 ms +20.16% -9.15% 6.26%
inserterOpen 41.35 ms +2.37% -10.62% 41.55 ms +14.61% -0.51% -0.48%
inserterHover 11.52 ms +15.28% -4.95% 11.49 ms +7.31% -12.71% 0.26%
inserterSearch 8.43 ms +7.59% -5.1% 8.07 ms +15.86% -5.58% 4.46%
loadPatterns 654.47 ms +5.06% -3.43% 649.68 ms +3.19% -7.63% 0.74%
wpTotal 484.87 ms +0.59% -6.5% 480.86 ms +0.65% -6.92% 0.83%
wpMemoryUsage 14.81 MB +0% -0% 14.77 MB +0% -0% 0.25%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric a7dd016 trunk % Change
serverResponse 294.65 ms +10.48% -0.91% 301.58 ms +4.08% -6.59% -2.3%
firstPaint 320.17 ms +13.56% -5.53% 310.14 ms +3.5% -5.47% 3.23%
domContentLoaded 673.66 ms +5.4% -2.58% 643.19 ms +1.48% -0.62% 4.74%
loaded 674.5 ms +5.41% -2.58% 644.02 ms +1.46% -0.62% 4.73%
firstContentfulPaint 379.91 ms +9.63% -3.36% 365.39 ms +3.86% -2.22% 3.97%
firstBlock 2053.21 ms +7.98% -1.3% 1966.52 ms +2.09% -0.36% 4.41%
type 15.14 ms +3.04% -5.68% 15.17 ms +3.96% -10.35% -0.2%
navigate 95.81 ms +8.25% -5.43% 88.35 ms +3.17% -0.54% 8.44%
loadPatterns 1142.4 ms +10.56% -6.57% 1132.15 ms +13.64% -6.68% 0.91%
loadPages 930.57 ms +5.4% -1.79% 969.86 ms +3.38% -5.35% -4.05%
wpTotal 286.29 ms +10.74% -0.97% 293.12 ms +4.2% -6.7% -2.33%
wpMemoryUsage 12.82 MB +0% -0% 12.79 MB +0% -0% 0.26%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

b7e7e12 Run

🏁 Flaky tests

Some 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 /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByLabel('Page One')
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByLabel('Page One') with timeout 5000ms
  - waiting for getByLabel('Page One')
    14 × locator resolved to <button type="button" aria-pressed="true" data-active-item="true" id="view-list-0-12-item-wrapper" class="dataviews-view-list__item" aria-labelledby="view-list-0-12-label" aria-describedby="view-list-0-12-description"></button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:193:49
Undo restores the post selection when another synced entity is loaded (RTC WebSocket) in /test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 2
+ Received  + 2

  Object {
    "attributeKey": "content",
    "blockIndex": 0,
    "content": "abcdef",
-   "endOffset": 3,
-   "offset": 3,
+   "endOffset": 1,
+   "offset": 1,
  }

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts:363:5
should apply a named font size using the font size buttons in /test/e2e/specs/editor/various/font-size-picker.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

- <!-- wp:paragraph {"fontSize":"large"} -->
+ <!-- wp:paragraph {"fontSize":"medium"} -->
- <p class="has-large-font-size">Paragraph to be made "large"</p>
+ <p class="has-medium-font-size">Paragraph to be made "large"</p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/font-size-picker.spec.js:153:6
should reset a named font size using the tools panel menu in /test/e2e/specs/editor/various/font-size-picker.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

- <!-- wp:paragraph {"fontSize":"medium"} -->
+ <!-- wp:paragraph {"fontSize":"small"} -->
- <p class="has-medium-font-size">Paragraph with font size reset using tools panel menu</p>
+ <p class="has-small-font-size">Paragraph with font size reset using tools panel menu</p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/font-size-picker.spec.js:178:6
should restore an older revision in /test/e2e/specs/editor/various/revisions.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

  Array [
    Object {
      "attributes": Object {
-       "content": "Original content - Updated content - Autosaved",
+       "content": "Original content",
      },
      "name": "core/paragraph",
    },
  ]

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/revisions.spec.js:146:5

b7e7e12 Run

claude and others added 2 commits November 15, 2026 09:11
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
@t-hamano
t-hamano requested a review from a team November 15, 2026 09:57
@t-hamano
t-hamano marked this pull request as ready for review November 15, 2026 09:57
@t-hamano
t-hamano requested a review from ellatrix as a code owner November 15, 2026 09:57

@ntsekouras ntsekouras 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.

Tests well and looks good, thanks!

@ciampo ciampo 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.

LGTM 🚀

@ntsekouras
ntsekouras merged commit 7806011 into trunk Nov 16, 2026
118 checks passed
@ntsekouras
ntsekouras deleted the fix/block-mover-focus-ring branch November 16, 2026 14:09
@github-actions github-actions Bot added this to the Gutenberg 24.5 milestone Nov 16, 2026
@t-hamano

Copy link
Copy Markdown
Contributor Author

Thanks for the review!

Vedant-Gandhi pushed a commit to Vedant-Gandhi/gutenberg that referenced this pull request Nov 30, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants