[Experimental] Rating filter: fix block focus and visibility (#52579)
This commit is contained in:
parent
f55759b892
commit
7c7895ade9
|
@ -32,6 +32,7 @@ import { EXCLUDED_BLOCKS } from '../../constants';
|
|||
import { Notice } from '../../components/notice';
|
||||
import type { Attributes } from './types';
|
||||
import './style.scss';
|
||||
import { InitialDisabled } from '../../components/initial-disabled';
|
||||
|
||||
const RatingFilterEdit = ( props: BlockEditProps< Attributes > ) => {
|
||||
const { attributes, setAttributes } = props;
|
||||
|
@ -189,30 +190,32 @@ const RatingFilterEdit = ( props: BlockEditProps< Attributes > ) => {
|
|||
/>
|
||||
|
||||
<div { ...innerBlocksProps }>
|
||||
{ showNoProductsNotice && (
|
||||
<Notice>
|
||||
{ __(
|
||||
"Your store doesn't have any products with ratings yet. This filter option will display when a product receives a review.",
|
||||
'woocommerce'
|
||||
) }
|
||||
</Notice>
|
||||
) }
|
||||
<div
|
||||
className={ clsx( {
|
||||
'is-loading': isLoading,
|
||||
} ) }
|
||||
>
|
||||
<BlockContextProvider
|
||||
value={ {
|
||||
filterData: {
|
||||
items: displayedOptions,
|
||||
isLoading,
|
||||
},
|
||||
} }
|
||||
<InitialDisabled>
|
||||
{ showNoProductsNotice && (
|
||||
<Notice>
|
||||
{ __(
|
||||
"Your store doesn't have any products with ratings yet. This filter option will display when a product receives a review.",
|
||||
'woocommerce'
|
||||
) }
|
||||
</Notice>
|
||||
) }
|
||||
<div
|
||||
className={ clsx( {
|
||||
'is-loading': isLoading,
|
||||
} ) }
|
||||
>
|
||||
{ children }
|
||||
</BlockContextProvider>
|
||||
</div>
|
||||
<BlockContextProvider
|
||||
value={ {
|
||||
filterData: {
|
||||
items: displayedOptions,
|
||||
isLoading,
|
||||
},
|
||||
} }
|
||||
>
|
||||
{ children }
|
||||
</BlockContextProvider>
|
||||
</div>
|
||||
</InitialDisabled>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
.wp-block-woocommerce-product-filter-rating {
|
||||
display: grid;
|
||||
|
||||
.wc-block-components-product-rating {
|
||||
margin-bottom: 0;
|
||||
display: flex;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
Comment: Experimental: Rating filter: fix block focus and visibility
|
||||
|
||||
|
Loading…
Reference in New Issue