mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
fix(breadcrumb): pass aria-current prop to Link
This commit is contained in:
parent
42f01372f0
commit
d978119cc4
2 changed files with 19 additions and 5 deletions
|
@ -15,17 +15,16 @@
|
|||
isCurrentPage && ariaCurrent !== 'page' && '--breadcrumb-item--current',
|
||||
className
|
||||
);
|
||||
$: itemProps = { 'aria-current': ariaCurrent, class: cx('--link') };
|
||||
</script>
|
||||
|
||||
{#if href}
|
||||
<li class={_class} {...props}>
|
||||
<Link {href} props={itemProps}>
|
||||
<Link {href} aria-current={ariaCurrent}>
|
||||
<slot />
|
||||
</Link>
|
||||
</li>
|
||||
{:else}
|
||||
<li class={_class} {...props}>
|
||||
<slot props={itemProps} />
|
||||
<slot props={{ 'aria-current': ariaCurrent, class: cx('--link') }} />
|
||||
</li>
|
||||
{/if}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue