From 5b3ecffbb23279660295643bb3c62e2ca7534885 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 23 Nov 2017 15:18:27 +0100 Subject: [PATCH] FIX: pick date and time was not reseting state --- .../future-date-input-selector.js.es6 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/select-kit/components/future-date-input-selector.js.es6 b/app/assets/javascripts/select-kit/components/future-date-input-selector.js.es6 index 961c7c2cf9..f91708655f 100644 --- a/app/assets/javascripts/select-kit/components/future-date-input-selector.js.es6 +++ b/app/assets/javascripts/select-kit/components/future-date-input-selector.js.es6 @@ -154,14 +154,17 @@ export default ComboBoxComponent.extend(DatetimeMixin, { }, mutateValue(value) { - if (this.get("isCustom")) return; - let input = null; - const { time } = this._updateAt(value); + if (this.get("isCustom")) { + this.set("value", value); + } else { + let input = null; + const { time } = this._updateAt(value); - if (time && !Ember.isEmpty(value)) { - input = time.format(FORMAT); + if (time && !Ember.isEmpty(value)) { + input = time.format(FORMAT); + } + + this.setProperties({ input, value }); } - - this.setProperties({ input, value }); }, });