Skip to content

Components: Synchronize popup hover and keyboard targets (7.2 backport) - #85829

Merged
ciampo merged 1 commit into
wp/7.2from
codex/backport-85487-wp-7.2
Oct 28, 2026
Merged

ciampo merged 1 commit into
wp/7.2from
codex/backport-85487-wp-7.2

Conversation

@ciampo

@ciampo ciampo commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Backports #85487 to wp/7.2.

What?

Synchronize pointer and keyboard targets in DropdownMenu, MenuItem, and Autocomplete.

Why?

Hover and keyboard navigation can identify different items. The automatic backport failed on a components changelog conflict.

How?

Apply a91cfa3bafa1aec63d22fca043068adaf43df652, adding only its changelog entry. Runtime changes match the merged PR. The Autocomplete browser test supplies empty keywords arrays because that field is still required on 7.2.

Testing Instructions

  1. In Storybook, open DropdownMenu Default with a pointer and hover its second item. Focus should follow the pointer. Press ArrowUp and Enter to activate the first item.
  2. Repeat with With Children. Check that consumer hover handlers still run. An onMouseMove handler that calls event.preventDefault() must retain control of focus across repeated pointer movement.
  3. Hover a disabled menu control. It should receive focus without activating. In a scrolling menu, hovering a partially visible item should focus it without scrolling.
  4. In the editor, open slash completion and hover another result. It should become selected while text focus stays in the editor. Press ArrowDown and Enter to apply the next result.
  5. Open LinkControl, search, and hover a result. Focus should stay in the input so typing can continue.

Testing Instructions for Keyboard

  1. Open DropdownMenu with the keyboard. Arrow navigation and Enter should work. Escape should close the menu and return focus to the trigger.
  2. After hovering a menu item or slash-completion result, use arrow keys without moving the pointer. The keyboard target should remain active, and Enter should activate it.
Local verification

The production build, components typecheck, and focused lint passed. All 66 focused unit and Chromium browser tests passed. Five imported browser checks fail on the original 7.2 runtime and pass with this backport. The editor steps above remain manual verification instructions.

Use of AI Tools

Codex applied the backport, resolved the changelog conflict, adapted the test fixtures, ran local verification, and drafted this description.

* Components: Prioritize keyboard targets over popup hover styles

* Fix single popup highlight changelog reference

* Components: Synchronize popup hover and keyboard targets

* MenuItem: Preserve consumer focus on hover

* DropdownMenu: Use real pointer interaction in scroll test

* MenuItem: Require explicit cancellation of hover focus

* MenuItem: Keep hover focus within the active menu

---

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
@github-actions github-actions Bot added the [Package] Components /packages/components label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 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: ciampo <mciampini@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>

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

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

📦 Bundle size

Size Change: +150 B (0%)

Total Size: 9.04 MB

📦 View Changed
Filename Size Change
build/scripts/components/index.min.js 371 kB +150 B (+0.04%)

4a1aedf Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 28ffad5 wp/7.2 % Change
timeToFirstByte 53.85 ms +17.08% -2.6% 56.7 ms +10.49% -4.14% -5.03%
largestContentfulPaint 94 ms +4.26% -6.38% 94 ms +6.38% -6.38% 0%
lcpMinusTtfb 34 ms +15.44% -6.32% 35.6 ms +17.28% -6.6% -4.49%
wpBeforeTemplate 29.15 ms +15.78% -2.33% 29.64 ms +14.41% -3.41% -1.65%
wpTemplate 21.05 ms +7.27% -3.37% 22.27 ms +4.04% -5.88% -5.48%
wpTotal 50.08 ms +16.87% -2.44% 52.61 ms +10.36% -3.61% -4.81%
wpMemoryUsage 7.69 MB +0% -0% 7.66 MB +0% -0% 0.42%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 28ffad5 wp/7.2 % Change
timeToFirstByte 46.15 ms +8.67% -1.52% 43 ms +5.35% -2.09% 7.33%
largestContentfulPaint 102 ms +3.92% -1.96% 92 ms +4.35% -0% 10.87%
lcpMinusTtfb 54.85 ms +3.28% -1.09% 49.7 ms +1.91% -2.21% 10.36%
wpBeforeTemplate 26.54 ms +8.44% -0.83% 27.64 ms +3.4% -2.97% -3.98%
wpTemplate 16.42 ms +2.38% -1.77% 12.55 ms +3.19% -2.79% 30.84%
wpTotal 42.88 ms +9.49% -0.91% 40.08 ms +5.51% -2.05% 6.99%
wpMemoryUsage 6.38 MB +0% -0% 6.24 MB +0% -0% 2.31%
wpDbQueries 13 +0% -0% 9 +0% -0% 44.44%

media-processing

Metric 28ffad5 wp/7.2 % Change
mediaProcessingJpeg 406.01 ms +1.53% -0.17% 405.27 ms +0.97% -0.77% 0.18%
mediaProcessingAvif 6120.14 ms +0.07% -0.17% 6133.71 ms +0.07% -0.04% -0.22%
mediaProcessingJpegToAvif 4228.81 ms +0.42% -0.65% 4239.2 ms +0.24% -0.35% -0.25%

media-upload

Metric 28ffad5 wp/7.2 % Change
jpegUploadProcessing 1702.87 ms +14.47% -15.79% 1423.66 ms +2.08% -0.82% 19.61%
pngUploadProcessing 193.47 ms +32.33% -4.24% 194.99 ms +13.3% -11.33% -0.78%
largeJpegUploadProcessing 1424.18 ms +1.03% -0.91% 1416.95 ms +1.21% -0.32% 0.51%
multipleImageUploadProcessing 2089.71 ms +0.16% -6.74% 2116.53 ms +0.92% -2.41% -1.27%

post-editor

Metric 28ffad5 wp/7.2 % Change
serverResponse 551.5 ms +3.7% -2.29% 524.74 ms +2.06% -4.46% 5.1%
firstPaint 338.71 ms +59.54% -22.75% 294.75 ms +3.95% -14.23% 14.91%
domContentLoaded 1330.22 ms +4.5% -3.76% 1265.15 ms +3.9% -3.91% 5.14%
loaded 1331.51 ms +4.49% -3.75% 1266.4 ms +3.9% -3.91% 5.14%
firstContentfulPaint 574.93 ms +4.92% -5.89% 533.09 ms +1.92% -31.7% 7.85%
firstBlock 4158.33 ms +2.61% -2.71% 4019.58 ms +0.56% -5.26% 3.45%
type 22.49 ms +3.47% -8.58% 20.13 ms +1.14% -3.58% 11.72%
typeWithoutInspector 21.4 ms +7.8% -5.23% 18.99 ms +2.95% -2.79% 12.69%
typeWithTopToolbar 26.77 ms +6.54% -1.23% 24.15 ms +5.63% -2.19% 10.85%
typeContainer 9.71 ms +8.96% -4.12% 8.87 ms +16.8% -4.28% 9.47%
focus 139.05 ms +1.17% -3.7% 132.81 ms +6.06% -1.48% 4.7%
firstFocus 282.29 ms +0% -0% 249.12 ms +0% -0% 13.31%
selectAll 629.91 ms +0.74% -0.22% 608.36 ms +3.43% -5.31% 3.54%
listViewOpen 90.82 ms +6.42% -9.27% 79.42 ms +7.63% -5.57% 14.35%
inserterOpen 46.36 ms +6.15% -4.72% 42.54 ms +4.77% -9.64% 8.98%
inserterHover 13.67 ms +6.22% -12.07% 12.51 ms +7.51% -11.51% 9.27%
inserterSearch 9.48 ms +1.05% -10.97% 9.51 ms +5.68% -14.83% -0.32%
loadPatterns 712.13 ms +2.1% -1.44% 658.68 ms +5.66% -3.13% 8.11%
wpTotal 541.11 ms +3.76% -2.34% 513.43 ms +2.23% -4.33% 5.39%
wpMemoryUsage 14.74 MB +0% -0% 14.71 MB +0% -0% 0.23%
wpDbQueries 55 +0% -1.82% 55 +0% -1.82% 0%

site-editor

Metric 28ffad5 wp/7.2 % Change
serverResponse 517.76 ms +3% -2.01% 493.54 ms +5.59% -7.27% 4.91%
firstPaint 273.63 ms +6.37% -6.2% 235.88 ms +25.35% -8.54% 16%
domContentLoaded 1315.52 ms +1.88% -1.93% 1277.44 ms +1.84% -1.73% 2.98%
loaded 1316.79 ms +1.85% -1.92% 1278.41 ms +1.86% -1.73% 3%
firstContentfulPaint 530.64 ms +4.05% -2% 518.6 ms +2.98% -37.66% 2.32%
firstBlock 4986.51 ms +2.69% -0.33% 4865.08 ms +0.73% -0.34% 2.5%
type 19.35 ms +4.96% -4.13% 18.75 ms +2.67% -3.04% 3.2%
navigate 123.67 ms +17.17% -4.23% 111.14 ms +20.68% -3.58% 11.27%
loadPatterns 1236.39 ms +1.29% -11.69% 1246.45 ms +8.64% -3.63% -0.81%
loadPages 1042.03 ms +1.37% -0.61% 1041.48 ms +1.92% -2.53% 0.05%
wpTotal 508.42 ms +3.14% -2.06% 483.9 ms +5.71% -7.27% 5.07%
wpMemoryUsage 12.76 MB +0% -0% 12.73 MB +0% -0% 0.24%
wpDbQueries 44 +2.27% -0% 44 +2.27% -0% 0%

4a1aedf 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.

As a user I expect my navigation to use the colors I selected for it in /test/e2e/specs/editor/blocks/navigation-colors.spec.js, passed after 1 failed attempt.
Error: locator.click: Error: strict mode violation: getByRole('option', { name: 'Pale cyan blue' }) resolved to 2 elements:
    1) <button type="button" role="option" tabindex="-1" aria-selected="false" aria-label="Pale cyan blue" id="components-circular-option-picker-0-9" class="components-button components-circular-option-picker__option is-next-40px-default-size"></button> aka locator('#components-circular-option-picker-0-9')
    2) <button type="button" role="option" tabindex="-1" aria-selected="false" aria-label="Pale cyan blue" id="components-circular-option-picker-1-21" class="components-button components-circular-option-picker__option is-next-40px-default-size"></button> aka locator('#components-circular-option-picker-1-21')

Call log:
  - waiting for getByRole('option', { name: 'Pale cyan blue' })

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/navigation-colors.spec.js:315:5
Backspace in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  -  5
+ Received  + 11

@@ -1,25 +1,31 @@
  Array [
    Object {
      "innerBlocks": Array [
        Object {
          "attributes": Object {
-           "content": "1",
+           "content": "1‸a",
          },
-         "innerBlocks": Array [
+         "innerBlocks": Array [],
+         "name": "core/list-item",
+       },
        Object {
+         "attributes": Object {
+           "content": "2",
+         },
          "innerBlocks": Array [
            Object {
              "attributes": Object {
-                   "content": "a‸2",
+               "ordered": false,
+               "values": "",
              },
-                 "name": "core/list-item",
-               },
+             "innerBlocks": Array [
                Object {
                  "attributes": Object {
                    "content": "b",
                  },
+                 "innerBlocks": Array [],
                  "name": "core/list-item",
                },
              ],
              "name": "core/list",
            },

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:2041:42
Custom Completer: should allow newlines after multiple option completions in /test/e2e/specs/editor/various/autocomplete-and-mentions.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

  <!-- wp:paragraph -->
  <p>🫐 test</p>
  <!-- /wp:paragraph -->

  <!-- wp:paragraph -->
- <p>🫐 test</p>
+ <p>🍎 test</p>
  <!-- /wp:paragraph -->

  <!-- wp:paragraph -->
  <p>🫐 test</p>
  <!-- /wp:paragraph -->

  <!-- wp:paragraph -->
- <p>🫐 test</p>
+ <p>🍎 test</p>
  <!-- /wp:paragraph -->

  <!-- wp:paragraph -->
  <p></p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/autocomplete-and-mentions.spec.js:466:6
Delete (forward) in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  -  5
+ Received  + 11

@@ -1,25 +1,31 @@
  Array [
    Object {
      "innerBlocks": Array [
        Object {
          "attributes": Object {
-           "content": "1",
+           "content": "1‸a",
          },
-         "innerBlocks": Array [
+         "innerBlocks": Array [],
+         "name": "core/list-item",
+       },
        Object {
+         "attributes": Object {
+           "content": "2",
+         },
          "innerBlocks": Array [
            Object {
              "attributes": Object {
-                   "content": "a‸2",
+               "ordered": false,
+               "values": "",
              },
-                 "name": "core/list-item",
-               },
+             "innerBlocks": Array [
                Object {
                  "attributes": Object {
                    "content": "b",
                  },
+                 "innerBlocks": Array [],
                  "name": "core/list-item",
                },
              ],
              "name": "core/list",
            },

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:2056:42
Navigation text does not inherit the link color from the theme/group in /test/e2e/specs/editor/blocks/navigation-colors.spec.js, passed after 1 failed attempt.
Error: locator.click: Error: strict mode violation: getByRole('option', { name: 'Vivid purple' }) resolved to 2 elements:
    1) <button type="button" role="option" tabindex="-1" aria-selected="false" aria-label="Vivid purple" id="components-circular-option-picker-0-11" class="components-button components-circular-option-picker__option is-next-40px-default-size"></button> aka getByRole('tabpanel', { name: 'Default' }).getByRole('option', { name: 'Vivid purple' })
    2) <button type="button" role="option" tabindex="-1" aria-selected="false" aria-label="Vivid purple" id="components-circular-option-picker-1-23" class="components-button components-circular-option-picker__option is-next-40px-default-size"></button> aka getByRole('tabpanel', { name: 'Hover' }).getByRole('option', { name: 'Vivid purple' })

Call log:
  - waiting for getByRole('option', { name: 'Vivid purple' })

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/navigation-colors.spec.js:177:5
Regression: updating a specific option will only change its value and will not corrupt others in /test/e2e/specs/editor/various/core-settings.spec.js, passed after 1 failed attempt.
Error: expect(received).toStrictEqual(expected) // deep equality

- Expected  - 1
+ Received  + 1

  Array [
    "rewrite_rules",
-   "SERIALIZED DATA",
+   "",
  ]
    at forEach (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/core-settings.spec.js:46:26)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/core-settings.spec.js:43:35

Should insert content using the global inserter in /test/e2e/specs/widgets/editing-widgets.spec.js, passed after 1 failed attempt.

applying block templates asynchronously does not create a persistent change in the editor in /test/e2e/specs/editor/various/inner-blocks-templates.spec.js, passed after 1 failed attempt.
Error: apiRequestContext.fetch: socket hang up
Call log:
  - → PUT http://localhost:8889/wp-json/wp/v2/plugins/gutenberg-test-plugins/inner-blocks-templates
    - user-agent: Playwright/1.63.0 (x64; ubuntu 24.04) node/24.20 CI/1
    - accept: */*
    - accept-encoding: gzip,deflate,br
    - X-WP-Nonce: 75c90022c4
    - content-type: application/json
    - content-length: 21
    - cookie: wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_23778236db82f19306f247e20a353a99=admin%7C1793358224%7C8c9M90YHKswSQNFvvSzNPvSZlBzB0qs5ZTWcpQrCb3d%7C581a622719208509c075f4e66ec4832f634fd9eac21d0071960b206b721f9dd7; wp-settings-time-1=1793185743

    at RequestUtils.rest (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/rest.ts:112:39)
    at RequestUtils.deactivatePlugin (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/plugins.ts:89:13)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/inner-blocks-templates.spec.js:17:3
can be converted to paragraphs in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 1
+ Received  + 1

  <!-- wp:paragraph -->
- <p>one</p>
+ <p>ne</p>
  <!-- /wp:paragraph -->

  <!-- wp:paragraph -->
  <p>two</p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:391:52
can be copied from multi selection in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

@@ -1,18 +1,18 @@
  <!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
- <li>one</li>
+ <li>ne</li>
  <!-- /wp:list-item -->

  <!-- wp:list-item -->
  <li>two</li>
  <!-- /wp:list-item --></ul>
  <!-- /wp:list -->

  <!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
- <li>one</li>
+ <li>ne</li>
  <!-- /wp:list-item -->

  <!-- wp:list-item -->
  <li>two</li>
  <!-- /wp:list-item --></ul>
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:33:49
should be immediately saved on indentation in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 1
+ Received  + 1

@@ -1,8 +1,8 @@
  <!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
- <li>one<!-- wp:list -->
+ <li>ne<!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
  <li></li>
  <!-- /wp:list-item --></ul>
  <!-- /wp:list --></li>
  <!-- /wp:list-item --></ul>

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:694:52
should change the indented list type in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('role=toolbar[name="Block tools"i]').locator('role=button[name="Indent"]')

    at Editor.clickBlockToolbarButton (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/editor/click-block-toolbar-button.ts:17:15)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:727:3
should cut and paste individual blocks with collapsed selection in /test/e2e/specs/editor/various/copy-cut-paste.spec.js, passed after 1 failed attempt.
Error: expect(string).toMatchSnapshot(expected) failed

  @@ -1,3 +1,3 @@
   <!-- wp:paragraph -->
  -<p>2Cut - collapsed selection</p>
  +<p>2</p>
   <!-- /wp:paragraph -->


    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/copy-cut-paste.spec.js:45:49
should format text across blocks in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

@@ -1,9 +1,9 @@
  Array [
    Object {
      "attributes": Object {
-       "content": "ab",
+       "content": "",
      },
      "name": "core/paragraph",
    },
    Object {
      "attributes": Object {

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/multi-block-selection.spec.js:2219:41
should gradually multi-select in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 3
+ Received  + 7

  Array [
    Object {
-     "name": "core/column",
+     "attributes": Object {
+       "content": "1",
+       "dropCap": false,
      },
-   Object {
-     "name": "core/column",
+     "clientId": "2f1774c1-2efb-4d30-863c-de3306619b0d",
+     "innerBlocks": Array [],
+     "isValid": true,
+     "name": "core/paragraph",
    },
  ]

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/multi-block-selection.spec.js:1200:5
should indent and outdent level 1 in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('role=toolbar[name="Block tools"i]').locator('role=button[name="Indent"]')

    at Editor.clickBlockToolbarButton (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/editor/click-block-toolbar-button.ts:17:15)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:775:3
should indent with Space and outdent with Shift+Space at the start in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

Truncated. See the full report.

4a1aedf Run

@ciampo ciampo self-assigned this Oct 28, 2026
@ciampo ciampo added the [Type] Bug An existing feature does not function as intended label Oct 28, 2026
@ciampo
ciampo requested a review from Mamaduka October 28, 2026 11:06
@ciampo
ciampo marked this pull request as ready for review October 28, 2026 11:06
@ciampo
ciampo requested a review from a team as a code owner October 28, 2026 11:06
@ciampo
ciampo requested a balanced review from Copilot October 28, 2026 11:35

Copilot AI 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.

🟢 Approval recommended

No active review issues remain for the backport synchronizing pointer and keyboard targets in popup menus and autocomplete results.

No open issues 🎉

What changed in this PR

Backports #85487 to WordPress 7.2, synchronizing pointer and keyboard targets in @wordpress/components popup menus and autocomplete results.

Changes:

  • Adds hover-driven menu focus and autocomplete selection while preserving consumer cancellation and text-input focus.
  • Adds browser and unit coverage, with autocomplete fixtures adapted for 7.2.
  • Records the backported fix in the components changelog.
File Description
packages/​components/​src/​menu-item/​test/​index.jsdom.test.tsx Tests focus boundaries and consumer hover-handler cancellation.
packages/​components/​src/​menu-item/​index.tsx Adds cancellable hover focus within the active menu.
packages/​components/​src/​dropdown-menu/​test/​index.browser.test.tsx Tests hover focus, keyboard continuation, disabled items, and scroll preservation.
packages/​components/​src/​dropdown-menu/​index.tsx Focuses hovered controls without scrolling.
packages/​components/​src/​autocomplete/​types.ts Adds the hover callback type.
packages/​components/​src/​autocomplete/​test/​index.jsdom.test.tsx Supplies the required hover callback in the existing fixture.
packages/​components/​src/​autocomplete/​test/​index.browser.test.tsx Tests hover selection and keyboard completion while retaining input focus.
packages/​components/​src/​autocomplete/​index.tsx Connects hover events to selection state.
packages/​components/​src/​autocomplete/​autocompleter-ui.tsx Forwards pointer movement to the hover callback.
packages/​components/​CHANGELOG.md Documents the synchronization fix.

Review effort: Balanced

@ciampo
ciampo merged commit 43c0efa into wp/7.2 Oct 28, 2026
100 checks passed
@ciampo
ciampo deleted the codex/backport-85487-wp-7.2 branch October 28, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants