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

[Regression]: Fix breadcrumbs html structure and React warnings #33159

Merged
merged 1 commit into from
Jul 2, 2021
Merged
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
31 changes: 16 additions & 15 deletions packages/block-editor/src/components/block-breadcrumb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,28 @@ function BlockBreadcrumb( { rootLabelText } ) {
</Button>
) }
{ ! hasSelection && rootLabel }
{ !! clientId && (
<Icon
icon={ chevronRightSmall }
className="block-editor-block-breadcrumb__separator"
/>
) }
</li>
<Icon
icon={ chevronRightSmall }
className="block-editor-block-breadcrumb__separator"
/>

{ parents.map( ( parentClientId ) => (
<>
<li key={ parentClientId }>
<Button
className="block-editor-block-breadcrumb__button"
variant="tertiary"
onClick={ () => selectBlock( parentClientId ) }
>
<BlockTitle clientId={ parentClientId } />
</Button>
</li>
<li key={ parentClientId }>
<Button
className="block-editor-block-breadcrumb__button"
variant="tertiary"
onClick={ () => selectBlock( parentClientId ) }
>
<BlockTitle clientId={ parentClientId } />
</Button>
<Icon
icon={ chevronRightSmall }
className="block-editor-block-breadcrumb__separator"
/>
</>
</li>
) ) }
{ !! clientId && (
<li
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
margin: 0;

li {
display: inline-block;
display: inline-flex;
margin: 0;
}

.block-editor-block-breadcrumb__separator {
fill: currentColor;
margin-left: -$grid-unit-05;
margin-right: -$grid-unit-05;
.block-editor-block-breadcrumb__separator {
fill: currentColor;
margin-left: -$grid-unit-05;
margin-right: -$grid-unit-05;

// Flip for RTL.
transform: scaleX(1) #{"/*rtl:scaleX(-1);*/"}; // This points the chevron right for LTR and left for RTL.
// Flip for RTL.
transform: scaleX(1) #{"/*rtl:scaleX(-1);*/"}; // This points the chevron right for LTR and left for RTL.
}

&:last-child {
&:last-child .block-editor-block-breadcrumb__separator {
display: none;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,5 @@ exports[`BlockBreadcrumb should render correctly 1`] = `
>
Document
</li>
<svg
aria-hidden="true"
class="block-editor-block-breadcrumb__separator"
focusable="false"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"
/>
</svg>
</ul>
`;