From 561c15aaff38c6dca64dd738243efe091e250283 Mon Sep 17 00:00:00 2001 From: Samuell1 Date: Tue, 23 Jan 2018 15:15:23 +0100 Subject: [PATCH] feat(MdDatepicker): allow reset of value after clicking cancel --- src/components/MdDatepicker/MdDatepicker.vue | 3 +++ src/components/MdDatepicker/MdDatepickerDialog.vue | 1 + 2 files changed, 4 insertions(+) diff --git a/src/components/MdDatepicker/MdDatepicker.vue b/src/components/MdDatepicker/MdDatepicker.vue index 7546eea62..5d9ff07ca 100644 --- a/src/components/MdDatepicker/MdDatepicker.vue +++ b/src/components/MdDatepicker/MdDatepicker.vue @@ -63,6 +63,9 @@ if (selectedDate) { this.modelDate = this.dateToHTMLString(selectedDate) this.$emit('input', selectedDate) + } else { + this.modelDate = null + this.$emit('input', null) } }, value () { diff --git a/src/components/MdDatepicker/MdDatepickerDialog.vue b/src/components/MdDatepicker/MdDatepickerDialog.vue index f0f029067..a582a0681 100644 --- a/src/components/MdDatepicker/MdDatepickerDialog.vue +++ b/src/components/MdDatepicker/MdDatepickerDialog.vue @@ -306,6 +306,7 @@ }, onCancel () { this.closeDialog() + this.$emit('update:mdDate', null) }, onConfirm () { this.closeDialog()