From adaac9c56492451206bbb35797dc3f4fdb4f9a53 Mon Sep 17 00:00:00 2001 From: "Baruch Odem (Rothkoff)" Date: Sun, 12 Apr 2020 16:57:12 +0300 Subject: [PATCH] feat: ignore clicks if directive value is falsy (#243) closes #242 --- src/directive.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/directive.js b/src/directive.js index c4b1e0d7..68204719 100644 --- a/src/directive.js +++ b/src/directive.js @@ -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)