Skip to content

Commit

Permalink
refactor: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-ub committed Aug 17, 2024
1 parent 0ca208e commit 5903de8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
25 changes: 0 additions & 25 deletions apps/www/src/components/SelectStyle/Select.astro
Original file line number Diff line number Diff line change
Expand Up @@ -111,31 +111,6 @@ const { html, panels } = processPanels(panelHtml);
}
}

switchTab(
newTab: HTMLAnchorElement | null | undefined,
index: number,
shouldSync = true
) {
if (!newTab) return;

// If tabs should be synced, we store the current position so we can restore it after
// switching tabs to prevent the page from jumping when the new tab content is of a different
// height than the previous tab.
const previousTabsOffset = shouldSync
? this.getBoundingClientRect().top
: 0;

if (shouldSync) {
newTab.focus();
SelectsPreview.#syncTabs(this, newTab.innerText);
window.scrollTo({
top:
window.scrollY +
(this.getBoundingClientRect().top - previousTabsOffset),
});
}
}

static #syncTabs(emitter: SelectsPreview, label: string | null) {
const syncKey = emitter.#syncKey;
if (!syncKey || !label) return;
Expand Down
2 changes: 1 addition & 1 deletion apps/www/src/components/starlight/SidebarSublist.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import { cn } from "@/lib/utils";
import { flattenSidebar, type SidebarEntry } from "../../utils/navigation";
import type { SidebarEntry } from "../../utils/navigation";
import { Badge } from "@astrojs/starlight/components";
interface Props {
Expand Down

0 comments on commit 5903de8

Please sign in to comment.