From 7925d86aa3cd8b1efaf3e8d82ba3962b45f76b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Parani=C4=8D?= <30797402+damuso@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:24:26 +0100 Subject: [PATCH] Form: reset not working, changed value not update input (#6767) * 6755 - update input value after form reset * code refactoring * fix: select button * cleanup --- .../src/baseeditableholder/BaseEditableHolder.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/core/src/baseeditableholder/BaseEditableHolder.vue b/packages/core/src/baseeditableholder/BaseEditableHolder.vue index b37a72254..f5ed9bde5 100644 --- a/packages/core/src/baseeditableholder/BaseEditableHolder.vue +++ b/packages/core/src/baseeditableholder/BaseEditableHolder.vue @@ -72,6 +72,14 @@ export default { handler(newValue) { this.d_value !== newValue && (this.d_value = newValue); } + }, + $formValue: { + immediate: false, + handler(newValue) { + if (this.$formName !== undefined && this.$pcForm?.states?.[this.$formName] && newValue !== this.d_value) { + this.d_value = newValue; + } + } } }, formField: {}, @@ -103,6 +111,9 @@ export default { $formDefaultValue() { return this.d_value ?? this.$pcFormField?.initialValue ?? this.$pcForm?.initialValues?.[this.$formName]; }, + $formValue() { + return this.$pcForm?.states?.[this.$formName]?.value; + }, controlled() { return this.$inProps.hasOwnProperty('modelValue') || (!this.$inProps.hasOwnProperty('modelValue') && !this.$inProps.hasOwnProperty('defaultValue')); },