diff --git a/src/Blazored.Typeahead/wwwroot/blazored-typeahead.js b/src/Blazored.Typeahead/wwwroot/blazored-typeahead.js index 1294963..9475cdd 100644 --- a/src/Blazored.Typeahead/wwwroot/blazored-typeahead.js +++ b/src/Blazored.Typeahead/wwwroot/blazored-typeahead.js @@ -3,7 +3,7 @@ window.blazoredTypeahead = { assemblyname: "Blazored.Typeahead", setFocus: function (element) { - if (element) element.focus(); + if (element && element.focus) element.focus(); }, // No need to remove the event listeners later, the browser will clean this up automagically. addKeyDownEventListener: function (element) { @@ -17,4 +17,4 @@ window.blazoredTypeahead = { }); } } -}; \ No newline at end of file +};