Skip to content

Commit

Permalink
Use anchor links for related items to fix shift+click and keyboard na…
Browse files Browse the repository at this point in the history
…vigation. Fixes #511
  • Loading branch information
techniq committed Nov 3, 2024
1 parent e8df0a0 commit df4e367
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions packages/svelte-ux/src/routes/docs/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -227,25 +227,19 @@
: item.type === 'github'
? mdiGithub
: mdiLink}
<ListItem
title={item.name.toString()}
{icon}
avatar={{ size: 'sm', class: 'text-xs text-white bg-primary' }}
on:click={() => {
if (item.url instanceof URL) {
// open in new window
window.open(item.url);
} else {
// go to route
goto(item.url);
}
}}
class="hover:bg-surface-200 cursor-pointer"
>
<div slot="actions">
<Icon data={mdiChevronRight} class="text-surface-content/50" />
</div>
</ListItem>
<a href={item.url.toString()} class="group">
<ListItem
title={item.name.toString()}
{icon}
avatar={{ size: 'sm', class: 'text-xs text-white bg-primary' }}
list="group"
class="hover:bg-surface-200 cursor-pointer"
>
<div slot="actions">
<Icon data={mdiChevronRight} class="text-surface-content/50" />
</div>
</ListItem>
</a>
{/each}
</div>
</div>
Expand Down

0 comments on commit df4e367

Please sign in to comment.