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 labelling, description, and focus style of the block transform to pattern previews #50577

Merged
merged 2 commits into from
May 18, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ function BlockPattern( { pattern, onSelect, composite } ) {
`${ baseClassName }-list__item-description`
);
return (
<div
className={ `${ baseClassName }-list__list-item` }
aria-label={ pattern.title }
aria-describedby={ pattern.description ? descriptionId : undefined }
>
<div className={ `${ baseClassName }-list__list-item` }>
<CompositeItem
role="option"
as="div"
{ ...composite }
aria-label={ pattern.title }
aria-describedby={
pattern.description ? descriptionId : undefined
}
className={ `${ baseClassName }-list__item` }
onClick={ () => onSelect( pattern.transformedBlocks ) }
>
Expand Down
11 changes: 6 additions & 5 deletions packages/block-editor/src/components/block-switcher/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,20 @@
}

.components-popover__content {
box-shadow: none;
width: 300px;
border: $border-width solid $gray-900;
background: $white;
border-radius: $radius-block-ui;
outline: none;
box-shadow: none;
}

.block-editor-block-switcher__preview {
width: 300px;
height: auto;
// Subtract margin from max-height.
// Subtract vertical margin from max-height.
max-height: calc(500px - #{$grid-unit-40});
margin: $grid-unit-20;
margin: $grid-unit-20 0;
// Use padding to prevent the pattern previews focus style from being cut-off.
padding: 0 $grid-unit-20;
overflow: hidden;
}
}
Expand Down