Skip to content

Commit

Permalink
fix: decode href before using as query selector (#951)
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Jul 8, 2022
1 parent 0dafee7 commit 22006e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client/theme-default/components/VPDocAsideOutline.vue
Expand Up @@ -22,7 +22,9 @@ const resolvedHeaders = computed(() => {
function handleClick({ target: el }: Event) {
const id = '#' + (el as HTMLAnchorElement).href!.split('#')[1]
const heading = document.querySelector(id) as HTMLAnchorElement
const heading = document.querySelector(
decodeURIComponent(id)
) as HTMLAnchorElement
heading?.focus()
}
</script>
Expand Down

0 comments on commit 22006e8

Please sign in to comment.