diff --git a/packages/block-editor/src/components/url-input/index.js b/packages/block-editor/src/components/url-input/index.js index 88562b719802b..39035bd1e9d4c 100644 --- a/packages/block-editor/src/components/url-input/index.js +++ b/packages/block-editor/src/components/url-input/index.js @@ -223,8 +223,14 @@ class URLInput extends Component { this.inputRef.current.focus(); } + static getDerivedStateFromProps( { showSuggestionsOverride }, { showSuggestions } ) { + return { + showSuggestions: showSuggestionsOverride !== undefined ? showSuggestionsOverride : showSuggestions, + }; + } + render() { - const { value = '', autoFocus = true, instanceId, className } = this.props; + const { value = '', autoFocus = true, instanceId, className, id, isFullWidth, hasBorder } = this.props; const { showSuggestions, suggestions, selectedSuggestion, loading } = this.state; const suggestionsListboxId = `block-editor-url-input-suggestions-${ instanceId }`; @@ -232,8 +238,12 @@ class URLInput extends Component { /* eslint-disable jsx-a11y/no-autofocus */ return ( -