diff --git a/packages/block-library/src/home-link/edit.js b/packages/block-library/src/home-link/edit.js index 85571c518c8621..464ccf18d144eb 100644 --- a/packages/block-library/src/home-link/edit.js +++ b/packages/block-library/src/home-link/edit.js @@ -56,7 +56,7 @@ export default function HomeEdit( { return ( <> -
  • +
    -
  • + ); } diff --git a/packages/block-library/src/navigation-link/edit.js b/packages/block-library/src/navigation-link/edit.js index b4efe383aa00c4..50ff5ed4ad2361 100644 --- a/packages/block-library/src/navigation-link/edit.js +++ b/packages/block-library/src/navigation-link/edit.js @@ -48,7 +48,7 @@ import { store as coreStore } from '@wordpress/core-data'; import { ItemSubmenuIcon } from './icons'; import { name } from './block.json'; -const ALLOWED_BLOCKS = [ 'core/navigation-link', 'core/spacer' ]; +const ALLOWED_BLOCKS = [ 'core/navigation-link' ]; const MAX_NESTING = 5; @@ -419,7 +419,6 @@ export default function NavigationLinkEdit( { hasDescendants ? InnerBlocks.DefaultAppender : false, - __experimentalAppenderTagName: 'li', } ); @@ -508,7 +507,7 @@ export default function NavigationLinkEdit( { /> -
  • +
    { /* eslint-disable jsx-a11y/anchor-is-valid */ } { /* eslint-enable */ } @@ -612,8 +611,8 @@ export default function NavigationLinkEdit( { ) } -
    diff --git a/packages/block-library/src/navigation/style.scss b/packages/block-library/src/navigation/style.scss index 4a5ae3b06c55c6..60b939799bb825 100644 --- a/packages/block-library/src/navigation/style.scss +++ b/packages/block-library/src/navigation/style.scss @@ -6,6 +6,17 @@ .wp-block-navigation { position: relative; + // Horizontal layout + display: flex; + flex-wrap: wrap; + align-items: center; + + // Vertical layout + &.is-vertical { + flex-direction: column; + align-items: flex-start; + } + // Normalize list styles. ul, ul li { diff --git a/packages/e2e-tests/specs/experiments/blocks/navigation.test.js b/packages/e2e-tests/specs/experiments/blocks/navigation.test.js index 4c389d1076970f..d5290e710d3fb7 100644 --- a/packages/e2e-tests/specs/experiments/blocks/navigation.test.js +++ b/packages/e2e-tests/specs/experiments/blocks/navigation.test.js @@ -348,7 +348,7 @@ describe( 'Navigation', () => { // Scope element selector to the Editor's "Content" region as otherwise it picks up on // block previews. const navBlockItemsLength = await page.$$eval( - '[aria-label="Editor content"][role="region"] li[aria-label="Block: Custom Link"]', + '[aria-label="Editor content"][role="region"] div[aria-label="Block: Custom Link"]', ( els ) => els.length ); diff --git a/packages/e2e-tests/specs/experiments/navigation-editor.test.js b/packages/e2e-tests/specs/experiments/navigation-editor.test.js index 301bbae01c705d..fa8bdf21d852ac 100644 --- a/packages/e2e-tests/specs/experiments/navigation-editor.test.js +++ b/packages/e2e-tests/specs/experiments/navigation-editor.test.js @@ -313,7 +313,7 @@ describe( 'Navigation editor', () => { // Select a link block with nested links in a submenu. const parentLinkXPath = - '//li[@aria-label="Block: Custom Link" and contains(.,"WordPress.org")]'; + '//div[@aria-label="Block: Custom Link" and contains(.,"WordPress.org")]'; const linkBlock = await page.waitForXPath( parentLinkXPath ); await linkBlock.click(); @@ -322,7 +322,7 @@ describe( 'Navigation editor', () => { // Submenus are hidden using `visibility: hidden` and shown using // `visibility: visible` so the visible/hidden options must be used // when selecting the elements. - const submenuLinkXPath = `${ parentLinkXPath }//li[@aria-label="Block: Custom Link"]`; + const submenuLinkXPath = `${ parentLinkXPath }//div[@aria-label="Block: Custom Link"]`; const submenuLinkVisible = await page.waitForXPath( submenuLinkXPath, { visible: true, } );