From dfbb218374cb371801724c4df55f314b55280e7f Mon Sep 17 00:00:00 2001 From: Konnor Rogers Date: Sat, 4 Oct 2025 00:39:07 -0400 Subject: [PATCH] fix broken checkboxes --- packages/webawesome/docs/docs/resources/changelog.md | 3 ++- packages/webawesome/src/components/checkbox/checkbox.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/webawesome/docs/docs/resources/changelog.md b/packages/webawesome/docs/docs/resources/changelog.md index 6549a8d07..a330b9135 100644 --- a/packages/webawesome/docs/docs/resources/changelog.md +++ b/packages/webawesome/docs/docs/resources/changelog.md @@ -16,6 +16,7 @@ Components with the Experimental badge sh - Fixed a bug in `` where slotted badges weren't properly positioned in buttons with an `href` [issue:1377] - Fixed focus outline styles in `` and native `
` [issue:1456] - Fixed focus outline styles in ``, ``, and `` [issue:1484] +- Fixed a bug in `` where it's value would revert to `""` when checked / unchecked [pr:] ## 3.0.0-beta.6 @@ -459,4 +460,4 @@ Many of these changes and improvements were the direct result of feedback from u
-Did we miss something? [Let us know!](https://github.com/shoelace-style/webawesome/discussions) +Did we miss something? [Let us know!](https://github.com/shoelace-style/webawesome/discussions) \ No newline at end of file diff --git a/packages/webawesome/src/components/checkbox/checkbox.ts b/packages/webawesome/src/components/checkbox/checkbox.ts index 7b6ae9e43..59c7514e7 100644 --- a/packages/webawesome/src/components/checkbox/checkbox.ts +++ b/packages/webawesome/src/components/checkbox/checkbox.ts @@ -80,7 +80,7 @@ export default class WaCheckbox extends WebAwesomeFormAssociatedElement { /** The value of the checkbox, submitted as a name/value pair with form data. */ get value(): string | null { - return this._value ?? 'on'; + return this.checked ? (this._value || 'on') : null; } @property({ reflect: true })