Skip to content

Commit df4e367

Browse files
committed
Use anchor links for related items to fix shift+click and keyboard navigation. Fixes #511
1 parent e8df0a0 commit df4e367

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

packages/svelte-ux/src/routes/docs/+layout.svelte

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -227,25 +227,19 @@
227227
: item.type === 'github'
228228
? mdiGithub
229229
: mdiLink}
230-
<ListItem
231-
title={item.name.toString()}
232-
{icon}
233-
avatar={{ size: 'sm', class: 'text-xs text-white bg-primary' }}
234-
on:click={() => {
235-
if (item.url instanceof URL) {
236-
// open in new window
237-
window.open(item.url);
238-
} else {
239-
// go to route
240-
goto(item.url);
241-
}
242-
}}
243-
class="hover:bg-surface-200 cursor-pointer"
244-
>
245-
<div slot="actions">
246-
<Icon data={mdiChevronRight} class="text-surface-content/50" />
247-
</div>
248-
</ListItem>
230+
<a href={item.url.toString()} class="group">
231+
<ListItem
232+
title={item.name.toString()}
233+
{icon}
234+
avatar={{ size: 'sm', class: 'text-xs text-white bg-primary' }}
235+
list="group"
236+
class="hover:bg-surface-200 cursor-pointer"
237+
>
238+
<div slot="actions">
239+
<Icon data={mdiChevronRight} class="text-surface-content/50" />
240+
</div>
241+
</ListItem>
242+
</a>
249243
{/each}
250244
</div>
251245
</div>

0 commit comments

Comments
 (0)