Check if blocks have been added to rich text editors before updating value (#35626)
* Check if blocks have been added to rich text editors before updating value * Add changelog entry
This commit is contained in:
parent
fc56dcf6e9
commit
ba91c94ca9
|
@ -213,6 +213,9 @@ export const ProductDetailsSection: React.FC = () => {
|
|||
blocks={ summaryBlocks }
|
||||
onChange={ ( blocks ) => {
|
||||
setSummaryBlocks( blocks );
|
||||
if ( ! summaryBlocks.length ) {
|
||||
return;
|
||||
}
|
||||
setValue(
|
||||
'short_description',
|
||||
serialize( blocks )
|
||||
|
@ -224,6 +227,9 @@ export const ProductDetailsSection: React.FC = () => {
|
|||
blocks={ descriptionBlocks }
|
||||
onChange={ ( blocks ) => {
|
||||
setDescriptionBlocks( blocks );
|
||||
if ( ! descriptionBlocks.length ) {
|
||||
return;
|
||||
}
|
||||
setValue( 'description', serialize( blocks ) );
|
||||
} }
|
||||
placeholder={ __(
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: dev
|
||||
|
||||
Check if blocks have been added to rich text editors before updating value
|
Loading…
Reference in New Issue