diff --git a/packages/block-editor/src/components/link-control/index.js b/packages/block-editor/src/components/link-control/index.js index 052e1ebc45a7b..eeeef1093dac5 100644 --- a/packages/block-editor/src/components/link-control/index.js +++ b/packages/block-editor/src/components/link-control/index.js @@ -158,7 +158,6 @@ const makeCancelable = ( promise ) => { function LinkControl( { searchInputPlaceholder, value, - id, settings, onChange = noop, noDirectEntry = false, @@ -178,7 +177,7 @@ function LinkControl( { const [ isEditingLink, setIsEditingLink ] = useState( forceIsEditingLink !== undefined ? forceIsEditingLink - : ! value || ( ! value.url && ! id ) + : ! value || ( ! value.url && ! value.id ) ); const [ isResolvingLink, setIsResolvingLink ] = useState( false ); const [ errorMessage, setErrorMessage ] = useState( null ); @@ -608,7 +607,7 @@ function LinkControl( { ) } - { typeof value.url === 'undefined' && ( + { typeof value.id !== 'undefined' && ( { value && value.title && ( diff --git a/packages/block-library/src/navigation-link/edit.js b/packages/block-library/src/navigation-link/edit.js index 4204b6841fdb6..ce1f0926a9bd5 100644 --- a/packages/block-library/src/navigation-link/edit.js +++ b/packages/block-library/src/navigation-link/edit.js @@ -63,6 +63,7 @@ function NavigationLinkEdit( { const { label, opensInNewTab, url, id, nofollow, description } = attributes; const link = { url, + id, opensInNewTab, title: label, }; @@ -249,7 +250,6 @@ function NavigationLinkEdit( {