Skip to content

Commit

Permalink
refactor: directly use first child instead of querying
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Apr 18, 2023
1 parent 09be057 commit 1769d32
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/client/app/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function handleHMR(route: Route): void {
// update route.data on HMR updates of active page
if (import.meta.hot) {
// hot reload pageData
import.meta.hot!.on('vitepress:pageData', (payload: PageDataPayload) => {
import.meta.hot.on('vitepress:pageData', (payload: PageDataPayload) => {
if (shouldHotReload(payload)) {
route.data = payload.pageData
}
Expand Down
2 changes: 1 addition & 1 deletion src/client/theme-default/components/VPLocalSearchBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ debouncedWatch(
?.scrollIntoView({ block: 'center' })
}
// FIXME: without this whole page scrolls to the bottom
el.value?.querySelector('.result')?.scrollIntoView({ block: 'start' })
resultsEl.value?.firstElementChild?.scrollIntoView({ block: 'start' })
},
{ debounce: 200, immediate: true }
)
Expand Down

0 comments on commit 1769d32

Please sign in to comment.