Skip to content

Commit

Permalink
Merge pull request #212 from baooab/patch-1
Browse files Browse the repository at this point in the history
Remove redundant judgments
  • Loading branch information
ndelvalle committed May 29, 2020
2 parents c9cb022 + d54d7c7 commit a7c322b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/v-click-outside.js
Expand Up @@ -29,9 +29,7 @@ function onEvent({ el, event, handler, middleware }) {
// In the meanwhile, we are using el.contains for those browsers, not
// the ideal solution, but using IE or EDGE is not ideal either.
const path = event.path || (event.composedPath && event.composedPath())
const outsideCheck = path ? path.indexOf(el) < 0 : !el.contains(event.target)

const isClickOutside = event.target !== el && outsideCheck
const isClickOutside = path ? path.indexOf(el) < 0 : !el.contains(event.target)

if (!isClickOutside) {
return
Expand Down

0 comments on commit a7c322b

Please sign in to comment.