diff --git a/packages/webawesome/docs/docs/resources/changelog.md b/packages/webawesome/docs/docs/resources/changelog.md
index f98c58c32..ae2a2a9d1 100644
--- a/packages/webawesome/docs/docs/resources/changelog.md
+++ b/packages/webawesome/docs/docs/resources/changelog.md
@@ -28,6 +28,8 @@ Components with the Experimental badge sh
- Fixed a bug in `` that caused tags to appear in alphabetical order instead of selection order when using `multiple`
- Improved performance of `` so initial rendering occurs faster, especially with multiple icons on the page [issue:1729]
- Improved `` to not throw an error when string values are passed to the `min`, `max`, and `step` properties [issue:1823]
+- Fixed a bug in Web Awesome form controls that caused `` to set the form property to equal `"foo"` instead of returning an `HTMLFormElement` breaking platform expectations. [pr:1815]
+- Fixed a bug in `` causing it to not copy over attributes for form submissions. [pr:1815]
- Improved performance of all components by fixing how CSS is imported and reused [issue:1812]
- Modified the default `transition` styles of `` to use design tokens [pr:1693]
diff --git a/packages/webawesome/src/components/button/button.ts b/packages/webawesome/src/components/button/button.ts
index 19a3dc6cf..146fdb83d 100644
--- a/packages/webawesome/src/components/button/button.ts
+++ b/packages/webawesome/src/components/button/button.ts
@@ -115,7 +115,6 @@ export default class WaButton extends WebAwesomeFormAssociatedElement {
* The "form owner" to associate the button with. If omitted, the closest containing form will be used instead. The
* value of this attribute must be an id of a form in the same document or shadow root as the button.
*/
- @property({ reflect: true }) form: string | null = null;
/** Used to override the form owner's `action` attribute. */
@property({ attribute: 'formaction' }) formAction: string;
@@ -135,24 +134,27 @@ export default class WaButton extends WebAwesomeFormAssociatedElement {
private constructLightDOMButton() {
const button = document.createElement('button');
+
+ for (const attribute of this.attributes) {
+ if (attribute.name === 'style') {
+ // Skip style attributes as they *shouldn't* be necessary
+ continue;
+ }
+ button.setAttribute(attribute.name, attribute.value);
+ }
+
button.type = this.type;
- button.style.position = 'absolute';
- button.style.width = '0';
- button.style.height = '0';
- button.style.clipPath = 'inset(50%)';
- button.style.overflow = 'hidden';
- button.style.whiteSpace = 'nowrap';
+ button.style.position = 'absolute !important';
+ button.style.width = '0 !important';
+ button.style.height = '0 !important';
+ button.style.clipPath = 'inset(50%) !important';
+ button.style.overflow = 'hidden !important';
+ button.style.whiteSpace = 'nowrap !important';
if (this.name) {
button.name = this.name;
}
button.value = this.value || '';
- ['form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget'].forEach(attr => {
- if (this.hasAttribute(attr)) {
- button.setAttribute(attr, this.getAttribute(attr)!);
- }
- });
-
return button;
}
diff --git a/packages/webawesome/src/components/checkbox/checkbox.ts b/packages/webawesome/src/components/checkbox/checkbox.ts
index 444472b1d..9af6d20f1 100644
--- a/packages/webawesome/src/components/checkbox/checkbox.ts
+++ b/packages/webawesome/src/components/checkbox/checkbox.ts
@@ -108,13 +108,6 @@ export default class WaCheckbox extends WebAwesomeFormAssociatedElement {
@property({ type: Boolean, reflect: true, attribute: 'checked' }) defaultChecked: boolean =
this.hasAttribute('checked');
- /**
- * By default, form controls are associated with the nearest containing `