Skip to content

Commit 1a6efba

Browse files
committedAug 5, 2023
fix(theme): scroll code group tab into view on selection
closes #2355 Co-authored-by: izayl <izayl@163.com>
1 parent 039798a commit 1a6efba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎src/client/app/composables/codeGroups.ts

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ export function useCodeGroups() {
3737

3838
current.classList.remove('active')
3939
next.classList.add('active')
40+
41+
const label = group?.querySelector(`label[for="${el.id}"]`)
42+
label?.scrollIntoView({ block: 'nearest' })
4043
}
4144
})
4245
}

0 commit comments

Comments
 (0)