From a7eb82c4755c52cc0ddae3c47b330d01d2eb4cb5 Mon Sep 17 00:00:00 2001 From: Sukhendu Sekhar Guria Date: Wed, 25 Dec 2024 17:26:01 +0530 Subject: [PATCH 1/2] Update link reset logic in SiteTitle --- packages/block-library/src/site-title/edit.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/block-library/src/site-title/edit.js b/packages/block-library/src/site-title/edit.js index 44b29173e06b03..939e6259a60843 100644 --- a/packages/block-library/src/site-title/edit.js +++ b/packages/block-library/src/site-title/edit.js @@ -123,16 +123,16 @@ export default function SiteTitleEdit( { label={ __( 'Settings' ) } resetAll={ () => { setAttributes( { - isLink: false, + isLink: true, linkTarget: '_self', } ); } } dropdownMenuProps={ dropdownMenuProps } > isLink !== false } + hasValue={ () => isLink === false } label={ __( 'Make title link to home' ) } - onDeselect={ () => setAttributes( { isLink: false } ) } + onDeselect={ () => setAttributes( { isLink: true } ) } isShownByDefault > Date: Thu, 26 Dec 2024 11:03:47 +0530 Subject: [PATCH 2/2] Fix condition for link value in SiteTitleEdit component --- packages/block-library/src/site-title/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/site-title/edit.js b/packages/block-library/src/site-title/edit.js index 939e6259a60843..0e3e96bd87cb3d 100644 --- a/packages/block-library/src/site-title/edit.js +++ b/packages/block-library/src/site-title/edit.js @@ -130,7 +130,7 @@ export default function SiteTitleEdit( { dropdownMenuProps={ dropdownMenuProps } > isLink === false } + hasValue={ () => ! isLink } label={ __( 'Make title link to home' ) } onDeselect={ () => setAttributes( { isLink: true } ) } isShownByDefault