Skip to content

Commit

Permalink
Fix Shift+Tab to Block Toolbar (#52613)
Browse files Browse the repository at this point in the history
* Fix Shift+Tab to Block Toolbar

* Add changelog entry
  • Loading branch information
diegohaz authored Jul 14, 2023
1 parent 63cec53 commit 09c02a4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

- `Popover`: Pin `react-dropdown-menu` version to avoid breaking changes in dependency updates. ([#52356](https://github.com/WordPress/gutenberg/pull/52356)).
- `Item`: Unify focus style and add default font styles. ([#52495](https://github.com/WordPress/gutenberg/pull/52495)).
- `Toolbar`: Fix toolbar items not being tabbable on the first render. ([#52613](https://github.com/WordPress/gutenberg/pull/52613))

## 25.3.0 (2023-07-05)

Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],
"types": "build-types",
"dependencies": {
"@ariakit/react": "^0.2.10",
"@ariakit/react": "^0.2.12",
"@babel/runtime": "^7.16.0",
"@emotion/cache": "^11.7.1",
"@emotion/css": "^11.7.1",
Expand Down
15 changes: 15 additions & 0 deletions test/e2e/specs/editor/various/navigable-toolbar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,19 @@ test.describe( 'Block Toolbar', () => {
expect( scrollTopBefore ).toBe( scrollTopAfter );
} );
} );

test( 'should focus with Shift+Tab', async ( {
editor,
page,
pageUtils,
} ) => {
await editor.insertBlock( { name: 'core/paragraph' } );
await page.keyboard.type( 'a' );
await pageUtils.pressKeys( 'shift+Tab' );
await expect(
page
.getByRole( 'toolbar', { name: 'Block Tools' } )
.getByRole( 'button', { name: 'Paragraph' } )
).toBeFocused();
} );
} );

1 comment on commit 09c02a4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 09c02a4.
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.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5550377351
📝 Reported issues:

Please sign in to comment.