Skip to content

Commit

Permalink
Merge pull request #266 from Scra3/fix-empty-target
Browse files Browse the repository at this point in the history
fix: when exceptSelector is defined and e.target is empty an error is thrown from closest function
  • Loading branch information
zeppelin authored Oct 3, 2024
2 parents a5224ba + 6c98feb commit c163597
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ember-click-outside/src/modifiers/on-click-outside.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default class ClickOutsideModifier extends Modifier {

_createHandler(element, action, exceptSelector) {
return (e) => {
if (exceptSelector && closest(e.target, exceptSelector)) {
if (exceptSelector && e.target && closest(e.target, exceptSelector)) {
return;
}

Expand Down

0 comments on commit c163597

Please sign in to comment.