Skip to content

Commit

Permalink
Apply correct conditions for showing suggestions and apply UI
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed May 26, 2023
1 parent 7ebe82a commit bd39b55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/block-editor/src/components/link-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ function LinkControl( {
// See https://github.com/WordPress/gutenberg/pull/33849/#issuecomment-932194927.
const showTextControl = hasLinkValue && hasTextControl;

const isEditing = ( isEditingLink || ! value ) && ! isCreatingPage;

return (
<div
tabIndex={ -1 }
Expand Down Expand Up @@ -349,7 +347,9 @@ function LinkControl( {
showInitialSuggestions={ showInitialSuggestions }
allowDirectEntry={ ! noDirectEntry }
showSuggestions={
hasLinkValue && valueHasChanges && showSuggestions
( ! hasLinkValue ||
( hasLinkValue && valueHasChanges ) ) &&
showSuggestions
}
suggestionsQuery={ suggestionsQuery }
withURLSuggestion={ ! noURLSuggestion }
Expand All @@ -370,7 +370,7 @@ function LinkControl( {
) }
</>

{ isEditing && (
{ hasLinkValue && ! isCreatingPage && (
<div className="block-editor-link-control__tools">
{ ( showSettings || showTextControl ) && (
<LinkControlSettingsDrawer
Expand Down

0 comments on commit bd39b55

Please sign in to comment.