refactor: directly use first child instead of querying

pull/2254/head
Divyansh Singh 1 year ago
parent 09be057ffb
commit 1769d329cc

@ -290,7 +290,7 @@ function handleHMR(route: Route): void {
// update route.data on HMR updates of active page // update route.data on HMR updates of active page
if (import.meta.hot) { if (import.meta.hot) {
// hot reload pageData // hot reload pageData
import.meta.hot!.on('vitepress:pageData', (payload: PageDataPayload) => { import.meta.hot.on('vitepress:pageData', (payload: PageDataPayload) => {
if (shouldHotReload(payload)) { if (shouldHotReload(payload)) {
route.data = payload.pageData route.data = payload.pageData
} }

@ -194,7 +194,7 @@ debouncedWatch(
?.scrollIntoView({ block: 'center' }) ?.scrollIntoView({ block: 'center' })
} }
// FIXME: without this whole page scrolls to the bottom // 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 } { debounce: 200, immediate: true }
) )

Loading…
Cancel
Save