From 36161997825b77b3a31a4090e273c12329be9d8c Mon Sep 17 00:00:00 2001 From: Westbrook Johnson Date: Thu, 2 Nov 2023 20:34:13 -0400 Subject: [PATCH] fix(field-group): apply role when none present --- packages/field-group/src/FieldGroup.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/field-group/src/FieldGroup.ts b/packages/field-group/src/FieldGroup.ts index ba75694f2b..68555841b3 100644 --- a/packages/field-group/src/FieldGroup.ts +++ b/packages/field-group/src/FieldGroup.ts @@ -61,6 +61,13 @@ export class FieldGroup extends ManageHelpText(SpectrumElement, { `; } + protected override firstUpdated(changes: PropertyValues): void { + super.firstUpdated(changes); + if (!this.hasAttribute('role')) { + this.setAttribute('role', 'group'); + } + } + protected override updated(changes: PropertyValues): void { super.updated(changes); if (changes.has('label')) {