Skip to content

Commit

Permalink
fix(soffit-pwa): set name on radio-group
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm committed Feb 6, 2023
1 parent 9dfb6f4 commit fd90c4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions uniquely/soffit-pwa/src/lottery-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export class AlwatrLotteryForm extends LocalizeMixin(AlwatrSmartElement) {

get _radioGroupOptions(): RadioGroupOptions {
return {
name: 'activity',
form: (this.constructor as typeof AlwatrLotteryForm).formId,
title: message('activity_type'),
radioGroup: [
{label: message('tile_player')},
Expand Down Expand Up @@ -136,7 +134,8 @@ export class AlwatrLotteryForm extends LocalizeMixin(AlwatrSmartElement) {
placeholder=${message('phone_number')}
></alwatr-text-field>
<alwatr-radio-group
.name=${this._radioGroupOptions.name}
name="activity"
.form="${AlwatrLotteryForm.formId}"
.options=${this._radioGroupOptions}
></alwatr-radio-group>
<div class="button-container">
Expand Down
6 changes: 3 additions & 3 deletions uniquely/soffit-pwa/src/tech-dep/radio-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ declare global {
export type RadioOption = {label: string; value?: string}

export type RadioGroupOptions = {
form: string;
name: string;
title: string;
radioGroup: Array<RadioOption>;
};
Expand Down Expand Up @@ -75,8 +73,10 @@ export class AlwatrFieldSet extends AlwatrDummyElement {
@property({type: Object})
options?: RadioGroupOptions;

name = this.getAttribute('name') ?? 'unknown';

@property({type: String})
name?: string;
form?: string;

get value(): string {
for (const inputElement of this.renderRoot.querySelectorAll('input')) {
Expand Down

0 comments on commit fd90c4d

Please sign in to comment.