fix broken checkboxes

This commit is contained in:
Konnor Rogers
2025-10-04 00:39:07 -04:00
parent 0eb8eaea00
commit dfbb218374
2 changed files with 3 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ Components with the <wa-badge variant="warning">Experimental</wa-badge> badge sh
- Fixed a bug in `<wa-button>` where slotted badges weren't properly positioned in buttons with an `href` [issue:1377]
- Fixed focus outline styles in `<wa-details>` and native `<details>` [issue:1456]
- Fixed focus outline styles in `<wa-scroller>`, `<wa-dialog>`, and `<wa-drawer>` [issue:1484]
- Fixed a bug in `<wa-checkbox>` 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
</details>
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)

View File

@@ -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 })