From e0ff15764128fecc0a643d14e1ee01f64ab67d0f Mon Sep 17 00:00:00 2001 From: Marc Roberts Date: Wed, 16 Oct 2024 18:53:44 +0200 Subject: [PATCH] fix(button): Include name and value properties on temporary submit button (#2351) The name and value used on the button element are not submitted as part of the form event as these are not cloned onto the temporary button used for submitting the form. --- packages/components/src/components/button/button.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/components/src/components/button/button.tsx b/packages/components/src/components/button/button.tsx index 385941a44e..a0e3f6e4eb 100644 --- a/packages/components/src/components/button/button.tsx +++ b/packages/components/src/components/button/button.tsx @@ -102,6 +102,12 @@ export class Button { if (this.type) { fakeButton.type = this.type; } + if (this.value) { + fakeButton.value = this.value; + } + if (this.name) { + fakeButton.name = this.name; + } fakeButton.style.display = 'none'; parentForm.appendChild(fakeButton); fakeButton.click();