Closed (fixed)
Project:
UI Suite DSFR
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
25 Jul 2023 at 09:31 UTC
Updated:
8 Aug 2023 at 09:34 UTC
Jump to comment: Most recent
There is a weird ternary condition in breadcrumb which can set an HTML attribute value as "null":
<a{{ item_attributes.addClass('fr-breadcrumb__link').setAttribute('href', url).setAttribute('aria-current', loop.last ? 'page' : null) }}
Once casted as string, this value will not be valid : https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attribut...
Replace by another condition:
{% set item_attributes = loop.last ? item_attributes.setAttribute('aria-current', 'page') : item_attributes %}
<a{{ item_attributes.addClass('fr-breadcrumb__link').setAttribute('href', url) }}>
Comments
Comment #3
pdureau commented