From d2a33fc3b5846479ee26f94301a6ec445c81ff10 Mon Sep 17 00:00:00 2001 From: Zach <4317446+zhegwood@users.noreply.github.com> Date: Fri, 20 Nov 2020 08:54:17 -0700 Subject: [PATCH] Ability to open without a click event. Would like the ability to programmatically open the datepicker modal without a click event using something like this.$refs.mydatepicker.open(). --- src/Datetime.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Datetime.vue b/src/Datetime.vue index a8d9e99..1b441a5 100644 --- a/src/Datetime.vue +++ b/src/Datetime.vue @@ -209,8 +209,9 @@ export default { this.$emit('input', datetime ? datetime.toISO() : '') }, open (event) { - event.target.blur() - + if (event) { + event.target.blur() + } this.isOpen = true }, close () {