empty icon datas in attributes when disabling the icon feature

This commit is contained in:
Antoine M 2023-11-09 18:19:47 +01:00
parent 3e54e7f0cf
commit 762227e0f3
5 changed files with 4 additions and 8 deletions

View File

@ -1 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'b8178c4637e6f7dc88cc'); <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'b0e7fd47b18a02c51167');

View File

@ -331,11 +331,9 @@ function Edit({
hasCustomImage: !hasCustomImage hasCustomImage: !hasCustomImage
}); });
if (!newHasAutoImage) { if (!newHasAutoImage) {
console.log("newHasAutoImage", newHasAutoImage); removeImageAttributes();
// setAttributes({ blockCustomTitle: undefined });
} }
} }
function setImageAttributes(image) { function setImageAttributes(image) {
setAttributes({ setAttributes({
imageId: image.id, imageId: image.id,

File diff suppressed because one or more lines are too long

View File

@ -10,7 +10,6 @@ $customImageUrl = $attributes['imageUrl'] ?? null;
$customImageAlt = $attributes['imageAlt'] ?? null; $customImageAlt = $attributes['imageAlt'] ?? null;
$customTitle = $attributes['blockCustomTitle'] ?? null; $customTitle = $attributes['blockCustomTitle'] ?? null;
?> ?>

View File

@ -68,8 +68,7 @@ export default function Edit({ attributes, setAttributes }) {
function onChangeHasCustomImage(newHasAutoImage) { function onChangeHasCustomImage(newHasAutoImage) {
setAttributes({ hasCustomImage: !hasCustomImage }); setAttributes({ hasCustomImage: !hasCustomImage });
if (!newHasAutoImage) { if (!newHasAutoImage) {
console.log("newHasAutoImage", newHasAutoImage); removeImageAttributes();
// setAttributes({ blockCustomTitle: undefined });
} }
} }
function setImageAttributes(image) { function setImageAttributes(image) {