Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix visual and DOM order of the list view header tabs and close button. #58942

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/editor/src/components/list-view-sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,6 @@ export default function ListViewSidebar() {
initialTabId="list-view"
>
<div className="edit-post-editor__document-overview-panel__header">
<Button
className="editor-list-view-sidebar__close-button"
icon={ closeSmall }
label={ __( 'Close' ) }
onClick={ closeListView }
/>
<Tabs.TabList
className="editor-list-view-sidebar__tabs-tablist"
ref={ tabsRef }
Expand All @@ -153,6 +147,12 @@ export default function ListViewSidebar() {
{ _x( 'Outline', 'Post overview' ) }
</Tabs.Tab>
</Tabs.TabList>
<Button
className="editor-list-view-sidebar__close-button"
icon={ closeSmall }
label={ __( 'Close' ) }
onClick={ closeListView }
/>
</div>

<Tabs.TabPanel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
}
.editor-list-view-sidebar__close-button {
background: $white;
order: 1;
align-self: center;
margin-right: $grid-unit-10;
}
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/various/list-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ test.describe( 'List View', () => {
// out of range of the sidebar region. Must shift+tab 2 times to reach
// close button before tab panel.
await pageUtils.pressKeys( 'shift+Tab' );
await pageUtils.pressKeys( 'shift+Tab' );
await expect(
page
.getByRole( 'region', { name: 'Document Overview' } )
Expand All @@ -379,6 +378,7 @@ test.describe( 'List View', () => {
// Focus the outline tab and select it. This test ensures the outline
// tab receives similar focus events based on the shortcut.
await pageUtils.pressKeys( 'shift+Tab' );
await pageUtils.pressKeys( 'shift+Tab' );
await page.keyboard.press( 'ArrowRight' );
const outlineButton = page.getByRole( 'tab', {
name: 'Outline',
Expand All @@ -388,7 +388,7 @@ test.describe( 'List View', () => {

// From here, tab in to the editor so focus can be checked on return to
// the outline tab in the sidebar.
await pageUtils.pressKeys( 'Tab', { times: 2 } );
await pageUtils.pressKeys( 'Tab', { times: 3 } );
// Focus should be placed on the outline tab button since there is
// nothing to focus inside the tab itself.
await pageUtils.pressKeys( 'access+o' );
Expand Down
1 change: 0 additions & 1 deletion test/e2e/specs/site-editor/list-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ test.describe( 'Site Editor List View', () => {
// out of range of the sidebar region. Must shift+tab 1 time to reach
// close button before list view area.
await pageUtils.pressKeys( 'shift+Tab' );
await pageUtils.pressKeys( 'shift+Tab' );
await expect(
page
.getByRole( 'region', { name: 'List View' } )
Expand Down
Loading