Improve error handling to help prevent runtime errors
Adds input validation and safe property access to utility functions to handle edge cases and invalid arguments gracefully
This commit is contained in:
parent
a3c581aa93
commit
9c5ed0dcca
3 changed files with 18 additions and 4 deletions
|
|
@ -297,7 +297,7 @@ class AutoComplete {
|
|||
// if a click is detected on the page, generally we hide the suggestions, unless the click was within the autocomplete elements
|
||||
checkOutsideClick(e) {
|
||||
if (e.target.id === 'txtLocation') return;
|
||||
if (e.target?.parentNode?.classList.contains(this.options.containerClass)) return;
|
||||
if (e.target?.parentNode?.classList?.contains(this.options.containerClass)) return;
|
||||
this.hideSuggestions();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue