allow focusing to description block

This commit is contained in:
Damián Suárez 2023-12-07 13:02:00 -03:00
parent 74e2e166c0
commit d602d928e5
2 changed files with 7 additions and 4 deletions

View File

@ -84,6 +84,7 @@ export function DescriptionBlockEdit( {
const blockProps = useWooBlockProps( attributes, {
className: classNames( { 'has-blocks': !! description.length } ),
tabIndex: 0,
} );
const innerBlockProps = useInnerBlocksProps(
@ -107,10 +108,7 @@ export function DescriptionBlockEdit( {
{ ! description.length && <div { ...innerBlockProps } /> }
{ !! description.length && (
<div
tabIndex={ 0 }
className="wp-block-woocommerce-product-description-field__cover"
/>
<div className="wp-block-woocommerce-product-description-field__cover" />
) }
{ !! description.length && (

View File

@ -1,5 +1,10 @@
.wp-block-woocommerce-product-description-field {
&:focus {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
outline: 3px solid transparent;
}
&.has-blocks {
min-height: 320px;
.wp-block-woocommerce-product-description-field__cover,