From 6119010c8d45bef42f57bee799bfa875ff2ca1b0 Mon Sep 17 00:00:00 2001 From: Marc Roberts Date: Wed, 11 Sep 2024 20:46:52 +0200 Subject: [PATCH] Include name and value properties on temporary submit button 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();