Gutenberg: Using the up arrow key to navigate to parent blocks no longer works properly

Created on 5 Dec 2019  路  3Comments  路  Source: WordPress/gutenberg

The issue

Pressing the up arrow key while your selection is on the first child block of another block should navigate to the parent block. At some point this behavior seems to have been broken and no longer works properly in master. This was working properly in Gutenberg 7.0.0.

I suspect this issue may be related to #18780 and #18881.

How to reproduce

  1. Create a new post.
  2. Insert a Group block.
  3. Insert any block inside the Group block.
  4. Press the up arrow key. Notice that you don't navigate to the Group block.
  5. Press the up arrow key again. Notice that you navigate to the post title, skipping the Group block entirely.

Environment

Accessibility (a11y) [Feature] Writing Flow [Status] In Progress [Type] Bug [Type] Regression [a11y] Keyboard & Focus

All 3 comments

Whatever fixes it should add an e2e test.

Appears to have been introduced by #18379

Fix proposed at #19135.

Whatever fixes it should add an e2e test.

As noted in the description of #19135, we do have an end-to-end test which attempts to verify this behavior (source). However, because it relied on the DOM as the source of truth, and because the active element in the DOM _was_ correct (despite it showing the wrong block's toolbar), the tests would pass. In #19135, I've updated the test to assert against both the DOM and the block editor state.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spocke picture spocke  路  3Comments

aaronjorbin picture aaronjorbin  路  3Comments

nylen picture nylen  路  3Comments

hedgefield picture hedgefield  路  3Comments

ellatrix picture ellatrix  路  3Comments