The logic assumes that the last breadcrumb item (the one for the current page) has href='' set on it. The Nimble breadcrumb documentation and Storybook example do not state or follow that convention.
If href is not set, aria-current does not get set.
Note that the breadcrumb item template bakes in this assumption by not rendering a link when its href is ''. This is reasonable, given that href='' indicates the current page, and the breadcrumb item for the current page should render as non-interactive text.
The code queries into the shadowRoots of child BreadcrumbItems.
The code is only run when slotted items change. It does not respond to changes in those slotted breadcrumbs' href values or changes in their children,. We need to consider the implications and ensure all valid use patterns result in aria-current being set correctly.
The logic implies that breadcrumb items support native a elements as content (as an alternative to setting an href directly on the breadcrumb item). Nimble breadcrumb items do not support that.
🧹 Tech Debt
FAST's breadcrumb has logic for updating
aria-current
on breadcrumb items, but there are multiple issues with it:The logic assumes that the last breadcrumb item (the one for the current page) has
href=''
set on it. The Nimble breadcrumb documentation and Storybook example do not state or follow that convention.href
is not set,aria-current
does not get set.href
is''
. This is reasonable, given thathref=''
indicates the current page, and the breadcrumb item for the current page should render as non-interactive text.The code queries into the
shadowRoot
s of childBreadcrumbItem
s.The code is only run when slotted items change. It does not respond to changes in those slotted breadcrumbs'
href
values or changes in their children,. We need to consider the implications and ensure all valid use patterns result inaria-current
being set correctly.The logic implies that breadcrumb items support native
a
elements as content (as an alternative to setting anhref
directly on the breadcrumb item). Nimble breadcrumb items do not support that.