diff --git a/src/connector.js b/src/connector.js index 096435e..0b52807 100644 --- a/src/connector.js +++ b/src/connector.js @@ -880,8 +880,11 @@ function openSuggestionsBox() { searchBoxElement.setAttribute( 'aria-expanded', 'true' ); } -// open the suggestions box +// close the suggestions box function closeSuggestionsBox() { + if( !suggestionsElement ) { + return; + } suggestionsElement.hidden = true; activeSuggestion = 0; searchBoxElement.setAttribute( 'aria-expanded', 'false' );