[Experimental] Fix: regression introduced in #44757 that breaks the inspector settings of the new attribute filter block (#45276)
Fix: regression introduced in #44757 that breaks the inspector settings of the new attribute filter block
This commit is contained in:
parent
6490682366
commit
91272dde6f
|
@ -18,17 +18,12 @@ import {
|
|||
* Internal dependencies
|
||||
*/
|
||||
import { AttributeSelectControls } from './attribute-select-controls';
|
||||
import { BlockAttributes } from '../types';
|
||||
import { EditProps } from '../types';
|
||||
|
||||
export const Inspector = ( {
|
||||
attributes,
|
||||
setAttributeId,
|
||||
}: {
|
||||
attributes: BlockAttributes;
|
||||
setAttributeId: ( id: unknown ) => void;
|
||||
} ) => {
|
||||
export const Inspector = ( { attributes, setAttributes }: EditProps ) => {
|
||||
const { attributeId, showCounts, queryType, displayStyle, selectType } =
|
||||
attributes;
|
||||
|
||||
return (
|
||||
<InspectorControls key="inspector">
|
||||
<PanelBody title={ __( 'Display Settings', 'woocommerce' ) }>
|
||||
|
@ -122,7 +117,11 @@ export const Inspector = ( {
|
|||
<AttributeSelectControls
|
||||
isCompact={ true }
|
||||
attributeId={ attributeId }
|
||||
setAttributeId={ setAttributeId }
|
||||
setAttributeId={ ( id: number ) => {
|
||||
setAttributes( {
|
||||
attributeId: id,
|
||||
} );
|
||||
} }
|
||||
/>
|
||||
</PanelBody>
|
||||
</InspectorControls>
|
||||
|
|
|
@ -241,18 +241,13 @@ const Edit = ( props: EditProps ) => {
|
|||
</Wrapper>
|
||||
);
|
||||
|
||||
const inspectorProps = {
|
||||
...props,
|
||||
setAttributeId,
|
||||
};
|
||||
|
||||
return (
|
||||
<Wrapper
|
||||
onClickToolbarEdit={ toggleEditing }
|
||||
isEditing={ isEditing }
|
||||
blockProps={ blockProps }
|
||||
>
|
||||
<Inspector { ...inspectorProps } />
|
||||
<Inspector { ...props } />
|
||||
<Disabled>
|
||||
{ displayStyle === 'dropdown' ? (
|
||||
<AttributeDropdown
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Experimental: Fix: Regression introduced in #44757 that breaks the inspector setting of the new attribute filter block.
|
Loading…
Reference in New Issue