-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Hello!
Question: How can I check a Radio by default inside a RadioGroup?
I tried:
- Setting the
checkedattribute to one of the Radios. This breaks the RadioGroup, now having 2 radios checked.

I figured the code invscode-radio-group.tscan be changed to allow initial checked Radio:
private _onSlotChange() {
if (!this._firstContentLoaded) {
+ this._checkedRadio = this._radios.findIndex((r) => r.checked);
const autoFocusedRadio = this._radios.findIndex((r) => r.autofocus);
if (autoFocusedRadio > -1) {
this._focusedRadio = autoFocusedRadio;
}
this._firstContentLoaded = true;
}- Setting the
defaultCheckedattribute to one of the Radios. This does nothing. It's like nothing was set in the first place. Does not break anything because it looks like it's ignored.
The result I want to end up to is having a Radio checked by default when I open my Webview. What is the recommended way to do this?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working