Skip to content

Commit 884f8cd

Browse files
committed
docs: Redirecting to first example if no example is selected
1 parent 5ad3b26 commit 884f8cd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apps/docs/src/components/example/Example.astro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
if (!exampleKey) {
7171
delete exampleMainEl.dataset.showExample;
7272
sourceButton.classList.add("hidden");
73+
74+
// Redirecting to the first example
75+
window.location.href = `#${Object.keys(examples)[0]}`;
7376
return;
7477
}
7578
const example = examples[exampleKey];

0 commit comments

Comments
 (0)