Skip to content

Commit

Permalink
Revert fix: respected disabled checked
Browse files Browse the repository at this point in the history
  • Loading branch information
TomMenga committed Dec 20, 2024
1 parent d154064 commit 96cd7d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ import '../radio-button-panel.js';
expect(element.value).to.be.equal(radio.value);
});

it('should respect disabled radio in value getter', async () => {
it('should ignore disabled radios', async () => {
const radio = radios[0];
radio.checked = true;
radio.disabled = true;
await waitForLitRender(element);

expect(element.value).to.be.equal('Value one');
expect(element.value).to.be.null;
});

it('should update disabled on children', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class SbbRadioButtonGroupElement extends SbbDisabledMixin(LitElement) {
}
}
public get value(): string | null {
return this.radioButtons.find((r) => r.checked)?.value ?? this._fallbackValue;
return this.radioButtons.find((r) => r.checked && !r.disabled)?.value ?? this._fallbackValue;
}
/**
* Used to preserve the `value` in case the radios are not yet 'loaded'
Expand Down

0 comments on commit 96cd7d4

Please sign in to comment.