Skip to content

Commit

Permalink
added the newlines back for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulharpal1603 committed Sep 12, 2024
1 parent 33d99b0 commit 93ddf9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { URLInput } from '../';
import LinkControlSearchResults from './search-results';
import { CREATE_TYPE } from './constants';
import useSearchHandler from './use-search-handler';

// Must be a function as otherwise URLInput will default
// to the fetchLinkSuggestions passed in block editor settings
// which will cause an unintended http request.
Expand Down Expand Up @@ -114,6 +115,7 @@ const LinkControlSearchInput = forwardRef(
);
}
};

return (
<div className="block-editor-link-control__search-input-container">
<URLInput
Expand Down
5 changes: 5 additions & 0 deletions packages/block-editor/src/components/url-input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
} from '@wordpress/compose';
import { withSelect } from '@wordpress/data';
import { isURL } from '@wordpress/url';

/**
* Internal dependencies
*/
Expand Down Expand Up @@ -424,6 +425,7 @@ class URLInput extends Component {
value = '',
hideLabelFromVision = false,
} = this.props;

const {
loading,
showSuggestions,
Expand All @@ -442,6 +444,7 @@ class URLInput extends Component {
} ),
hideLabelFromVision,
};

const inputProps = {
id: inputId,
value,
Expand All @@ -464,9 +467,11 @@ class URLInput extends Component {
ref: this.inputRef,
suffix: this.props.suffix,
};

if ( renderControl ) {
return renderControl( controlProps, inputProps, loading );
}

return (
<BaseControl __nextHasNoMarginBottom { ...controlProps }>
<InputControl { ...inputProps } __next40pxDefaultSize />
Expand Down

0 comments on commit 93ddf9c

Please sign in to comment.