Skip to content

Commit

Permalink
Accessibility: don't tab to block drag handle (#19211)
Browse files Browse the repository at this point in the history
* Accessibility: don't tab to block drag handle

* Adjust e2e tests
  • Loading branch information
ellatrix authored Dec 18, 2019
1 parent 77a18d8 commit 67cb1cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/block-editor/src/components/block-mover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ export class BlockMover extends Component {
icon={ dragHandle }
className="block-editor-block-mover__control-drag-handle block-editor-block-mover__control"
aria-hidden="true"
// Should not be able to tab to drag handle as this
// button can only be used with a pointer device.
tabIndex="-1"
onDragStart={ onDraggableStart }
onDragEnd={ onDraggableEnd }
draggable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ const tabThroughBlockMoverControl = async () => {
);
await expect( isFocusedMoveUpControl ).toBe( true );

// Tab to focus the drag handle
await page.keyboard.press( 'Tab' );

// Tab to focus on the 'move down' control
await page.keyboard.press( 'Tab' );
const isFocusedMoveDownControl = await page.evaluate( () =>
Expand Down

0 comments on commit 67cb1cc

Please sign in to comment.