Skip to content

Commit

Permalink
Checks element is not null and is focusable (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yousef Shanawany authored Sep 24, 2020
1 parent 99a57b3 commit 5b172c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Blazored.Typeahead/wwwroot/blazored-typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -17,4 +17,4 @@ window.blazoredTypeahead = {
});
}
}
};
};

0 comments on commit 5b172c2

Please sign in to comment.