NO BUG: Can't change role attribute of ul tag in accordion element

Hello,

the accordion element ul tag has a presentation role (role=“presentation”) that is not accessible.

And I can’t change it to role=“list”

I’ve tried custom attributes (Custom Attributes – Bricks Academy) but it add list value to presentation value so I have role=“presentation list”, and it’s not accessible…

Hi Oli,
Thanks so much for your report!

You can use this filter to change the role, if you want to:

add_filter(
	'bricks/element/render_attributes',
	function( $attributes, $key, $element ) {
		if ( $element->name === 'accordion' && $key === '_root' ) {
			$attributes[ $key ]['role'] = 'list';
		}

		return $attributes;
	},
	10,
	3
);

Best regards,
timmse

Thanks , it’s OK now!