Skip to content

Commit

Permalink
removes id from LinkControl
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Jul 9, 2020
1 parent 8cbb49e commit f474b7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions packages/block-editor/src/components/link-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ const makeCancelable = ( promise ) => {
function LinkControl( {
searchInputPlaceholder,
value,
id,
settings,
onChange = noop,
noDirectEntry = false,
Expand All @@ -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 );
Expand Down Expand Up @@ -608,7 +607,7 @@ function LinkControl( {
</span>
) }

{ typeof value.url === 'undefined' && (
{ typeof value.id !== 'undefined' && (
<span className="block-editor-link-control__search-item-header">
{ value && value.title && (
<span className="block-editor-link-control__search-item-info">
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function NavigationLinkEdit( {
const { label, opensInNewTab, url, id, nofollow, description } = attributes;
const link = {
url,
id,
opensInNewTab,
title: label,
};
Expand Down Expand Up @@ -249,7 +250,6 @@ function NavigationLinkEdit( {
<LinkControl
className="wp-block-navigation-link__inline-link-input"
value={ link }
id={ id }
showInitialSuggestions={ true }
createSuggestion={
userCanCreatePages
Expand Down

0 comments on commit f474b7f

Please sign in to comment.