Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Product SKU: Make the block focusable in editor #8804

Merged
merged 1 commit into from
Mar 22, 2023
Merged
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
6 changes: 4 additions & 2 deletions assets/js/atomic/blocks/product-elements/sku/edit.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* External dependencies
*/
import { useBlockProps } from '@wordpress/block-editor';
import type { BlockEditProps } from '@wordpress/blocks';
import EditProductLink from '@woocommerce/editor-components/edit-product-link';
import { ProductQueryContext as Context } from '@woocommerce/blocks/product-query/types';
Expand All @@ -17,6 +18,7 @@ const Edit = ( {
setAttributes,
context,
}: BlockEditProps< Attributes > & { context: Context } ): JSX.Element => {
const blockProps = useBlockProps();
const blockAttrs = {
...attributes,
...context,
Expand All @@ -29,10 +31,10 @@ const Edit = ( {
);

return (
<>
<div { ...blockProps }>
<EditProductLink />
<Block { ...blockAttrs } />
</>
</div>
);
};

Expand Down