Fix error displaying block after removing variation (#40255)

* Fix error displaying block after removing variation

* Disable Add button

* Add changelog
This commit is contained in:
Fernando Marichal 2023-09-19 13:31:32 -03:00 committed by GitHub
parent 6aa55f6334
commit d72316490d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
Fix error displaying block after removing variation #40255

View File

@ -403,7 +403,9 @@ export const NewAttributeModal: React.FC< NewAttributeModalProps > = ( {
}
value={
attribute ===
null
null ||
attribute ===
undefined
? []
: attribute.terms
}
@ -506,7 +508,9 @@ export const NewAttributeModal: React.FC< NewAttributeModalProps > = ( {
label={ addAccessibleLabel }
disabled={
values.attributes.length === 1 &&
values.attributes[ 0 ] === null
( values.attributes[ 0 ] === null ||
values.attributes[ 0 ] ===
undefined )
}
onClick={ () =>
onAddingAttributes( values )