Skip to content

Commit

Permalink
fix: RadioGroup text type error (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
CatchABus authored Jul 30, 2024
1 parent a2d51c5 commit 5ad85b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/RadioGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class RadioGroup extends Container
{
this.options = options;

this.value = options.items[options.selectedItem || 0].labelText.text;
this.value = options.items[options.selectedItem || 0].labelText?.text;

this.selected = options.selectedItem ?? 0; // first item by default

Expand Down Expand Up @@ -153,10 +153,10 @@ export class RadioGroup extends Container

if (this.selected !== id)
{
this.onChange.emit(id, this.items[id].labelText.text);
this.onChange.emit(id, this.items[id].labelText?.text);
}

this.value = this.options.items[id].labelText.text;
this.value = this.options.items[id].labelText?.text;
this.selected = id;
}
}

0 comments on commit 5ad85b1

Please sign in to comment.