Skip to content

Commit

Permalink
feat: ignore clicks if directive value is falsy (#243)
Browse files Browse the repository at this point in the history
closes #242
  • Loading branch information
baruchiro authored Apr 12, 2020
1 parent 3dd7bb8 commit adaac9c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ function getBinding(el) {
}

function handleClick(e) {
const ctx = getBinding(this).binding
if (!ctx.value) return

e.preventDefault()
let ctx = getBinding(this).binding

if (typeof ctx.value === 'string') {
return scrollTo(ctx.value)
Expand Down

0 comments on commit adaac9c

Please sign in to comment.