Skip to content

Commit

Permalink
fix(theme): scroll code group tab into view on selection
Browse files Browse the repository at this point in the history
closes #2355
Co-authored-by: izayl <izayl@163.com>
  • Loading branch information
brc-dd committed Aug 5, 2023
1 parent 039798a commit 1a6efba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/client/app/composables/codeGroups.ts
Expand Up @@ -37,6 +37,9 @@ export function useCodeGroups() {

current.classList.remove('active')
next.classList.add('active')

const label = group?.querySelector(`label[for="${el.id}"]`)
label?.scrollIntoView({ block: 'nearest' })
}
})
}
Expand Down

0 comments on commit 1a6efba

Please sign in to comment.