diff --git a/packages/block-editor/src/components/link-control/index.js b/packages/block-editor/src/components/link-control/index.js index bdf9112ef0153b..eeeef1093dac59 100644 --- a/packages/block-editor/src/components/link-control/index.js +++ b/packages/block-editor/src/components/link-control/index.js @@ -177,7 +177,7 @@ function LinkControl( { const [ isEditingLink, setIsEditingLink ] = useState( forceIsEditingLink !== undefined ? forceIsEditingLink - : ! value || ! value.url + : ! value || ( ! value.url && ! value.id ) ); const [ isResolvingLink, setIsResolvingLink ] = useState( false ); const [ errorMessage, setErrorMessage ] = useState( null ); @@ -273,7 +273,6 @@ function LinkControl( { return Promise.resolve( [ { - id: val, title: val, url: type === 'URL' ? prependHTTP( val ) : val, type, @@ -592,19 +591,31 @@ function LinkControl( { } ) } > - - - { ( value && value.title ) || displayURL } - - { value && value.title && ( - - { displayURL } - - ) } - + { typeof value.url !== 'undefined' && ( + + + { ( value && value.title ) || displayURL } + + { value && value.title && ( + + { displayURL } + + ) } + + ) } + + { typeof value.id !== 'undefined' && ( + + { value && value.title && ( + + { value.title } + + ) } + + ) }