From 1dcb406821f26b5e1ba7c35687c79384f58af746 Mon Sep 17 00:00:00 2001 From: Ilyas Amezouar Date: Thu, 4 Apr 2019 19:10:16 +0200 Subject: [PATCH 1/3] :bug: Emit `input` event on passwordMain change in HdPasswordConfirm --- src/components/form/HdPasswordConfirm.vue | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/form/HdPasswordConfirm.vue b/src/components/form/HdPasswordConfirm.vue index 3fcdb20d5..f1ed823fd 100644 --- a/src/components/form/HdPasswordConfirm.vue +++ b/src/components/form/HdPasswordConfirm.vue @@ -82,7 +82,8 @@ export default { value() { this.passwordMain = this.value; }, - passwordMain() { + passwordMain(value) { + this.$emit('input', value); this.$nextTick(this.validate); }, passwordConfirm() { @@ -100,10 +101,6 @@ export default { }, }, methods: { - fieldDataChange() { - this.$emit('input', this.passwordMain); - this.$nextTick(this.validate); - }, validate() { const inputsAreMatching = this.checkPasswordMatching(); const passwordIsLongEnough = this.checkPasswordLength(); From 74318bd77986acd9f42bf178bd23387641fa5de0 Mon Sep 17 00:00:00 2001 From: Ilyas Amezouar Date: Thu, 4 Apr 2019 22:05:32 +0200 Subject: [PATCH 2/3] :bug: Added missing form components to HdDynamicForm --- src/components/form/HdDynamicForm.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/form/HdDynamicForm.vue b/src/components/form/HdDynamicForm.vue index efebd72fd..4771b61ae 100644 --- a/src/components/form/HdDynamicForm.vue +++ b/src/components/form/HdDynamicForm.vue @@ -25,6 +25,9 @@ import HdInput from 'hd-blocks/components/form/HdInput.vue'; import HdCheckbox from 'hd-blocks/components/form/HdCheckbox.vue'; import HdRadio from 'hd-blocks/components/form/HdRadio.vue'; import HdPasswordConfirm from 'hd-blocks/components/form/HdPasswordConfirm.vue'; +import HdTextarea from 'hd-blocks/components/form/HdTextarea.vue'; +import HdSelect from 'hd-blocks/components/form/HdSelect.vue'; +import HdTagsSelector from 'hd-blocks/components/form/HdTagsSelector.vue'; export default { name: 'HdDynamicForm', @@ -101,6 +104,12 @@ export default { return HdRadio; case 'passwordConfirm': return HdPasswordConfirm; + case 'textarea': + return HdTextarea; + case 'select': + return HdSelect; + case 'tagsSelector': + return HdTagsSelector; default: return null; } From 4f51518935363384be83b894cb7058759efa1338 Mon Sep 17 00:00:00 2001 From: Ilyas Amezouar Date: Mon, 8 Apr 2019 12:03:08 +0200 Subject: [PATCH 3/3] :art: Use the value of the watcher --- src/components/HdEditSwitch.vue | 4 ++-- src/components/form/HdPasswordConfirm.vue | 4 ++-- src/components/form/HdSelect.vue | 4 ++-- src/components/form/HdTagsSelector.vue | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/HdEditSwitch.vue b/src/components/HdEditSwitch.vue index e753d7e2e..07ee8b3e7 100644 --- a/src/components/HdEditSwitch.vue +++ b/src/components/HdEditSwitch.vue @@ -116,8 +116,8 @@ export default { }; }, watch: { - editing() { - this.isEditMode = this.editing; + editing(value) { + this.isEditMode = value; }, }, computed: { diff --git a/src/components/form/HdPasswordConfirm.vue b/src/components/form/HdPasswordConfirm.vue index f1ed823fd..5564961ac 100644 --- a/src/components/form/HdPasswordConfirm.vue +++ b/src/components/form/HdPasswordConfirm.vue @@ -79,8 +79,8 @@ export default { }; }, watch: { - value() { - this.passwordMain = this.value; + value(value) { + this.passwordMain = value; }, passwordMain(value) { this.$emit('input', value); diff --git a/src/components/form/HdSelect.vue b/src/components/form/HdSelect.vue index 2266e3214..96f88d095 100644 --- a/src/components/form/HdSelect.vue +++ b/src/components/form/HdSelect.vue @@ -100,8 +100,8 @@ export default { }, }, watch: { - value() { - this.currentValue = this.value; + value(value) { + this.currentValue = value; }, currentValue() { this.handleChange(); diff --git a/src/components/form/HdTagsSelector.vue b/src/components/form/HdTagsSelector.vue index 74a2cbce8..d103911eb 100644 --- a/src/components/form/HdTagsSelector.vue +++ b/src/components/form/HdTagsSelector.vue @@ -71,8 +71,8 @@ export default { }, }, watch: { - value() { - this.selectedTags = this.value; + value(value) { + this.selectedTags = value; }, }, mounted() {