Compare commits

..

1 Commits

Author SHA1 Message Date
Frédéric Péters 4e38acb959 a11y: add group role to blocks (#88620)
gitea/wcs/pipeline/head This commit looks good Details
2024-03-25 20:43:36 +01:00
1 changed files with 5 additions and 1 deletions

View File

@ -504,7 +504,11 @@ class BlockWidget(WidgetList):
@property
def a11y_role(self):
if len([x for x in (self.block.fields or []) if not x.is_no_data_field]) > 1:
# don't mark block as a group if it has no label or no multiple data fields
if (
self.label_display != 'hidden'
and len([x for x in (self.block.fields or []) if not x.is_no_data_field]) > 1
):
return 'group'
return None