From 4dd81b3fd75e214e0917198125751e64edec9959 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 20 Jul 2020 11:09:43 +0100 Subject: [PATCH] Prevent JavaScript error when using arrow navigation in URLInput --- 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 adbc88e018f5e..b567bc343243a 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,