From 39ebeb54685a320299889019f2bf31218265bbee Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 20 Jul 2020 12:36:44 +0100 Subject: [PATCH] Prevent JavaScript error when using arrow navigation in URLInput (#24047) --- packages/block-editor/src/components/url-input/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/url-input/index.js b/packages/block-editor/src/components/url-input/index.js index adbc88e018f5ed..b567bc343243ae 100644 --- a/packages/block-editor/src/components/url-input/index.js +++ b/packages/block-editor/src/components/url-input/index.js @@ -64,10 +64,10 @@ class URLInput extends Component { if ( showSuggestions && selectedSuggestion !== null && + this.suggestionNodes[ selectedSuggestion ] && ! this.scrollingIntoView ) { this.scrollingIntoView = true; - scrollIntoView( this.suggestionNodes[ selectedSuggestion ], this.autocompleteRef.current,