From 098278b3e1add26c7689852a836765fa4f721e69 Mon Sep 17 00:00:00 2001 From: Mustaque Ahmed Date: Fri, 5 Nov 2021 18:52:38 +0530 Subject: [PATCH] Fix navigation block link control zero value in it. (#36198) In this commit, I have written condition properly. Zero was coming because of conditional rendering where we should not put number on the left side of && (logical and) operator. --- packages/block-editor/src/components/link-control/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/link-control/index.js b/packages/block-editor/src/components/link-control/index.js index 6581f1180a91b..2976d021241fc 100644 --- a/packages/block-editor/src/components/link-control/index.js +++ b/packages/block-editor/src/components/link-control/index.js @@ -261,7 +261,7 @@ function LinkControl( { // Only show text control once a URL value has been committed // and it isn't just empty whitespace. // See https://github.com/WordPress/gutenberg/pull/33849/#issuecomment-932194927. - const showTextControl = value?.url?.trim()?.length && hasTextControl; + const showTextControl = value?.url?.trim()?.length > 0 && hasTextControl; return (