Skip to content

Commit 51661de

Browse files
authored
fix(theme): prevent glitch when algolia chunk is loaded (#2519)
1 parent 5013835 commit 51661de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/client/theme-default/components/VPNavBarSearch.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const { theme, localeIndex } = useData()
2626
// payload), we delay initializing it until the user has actually clicked or
2727
// hit the hotkey to invoke it.
2828
const loaded = ref(false)
29+
const actuallyLoaded = ref(false)
2930
3031
const buttonText = computed(() => {
3132
const options = theme.value.search?.options ?? theme.value.algolia
@@ -169,9 +170,10 @@ const provider = __ALGOLIA__ ? 'algolia' : __VP_LOCAL_SEARCH__ ? 'local' : ''
169170
<VPAlgoliaSearchBox
170171
v-if="loaded"
171172
:algolia="theme.search?.options ?? theme.algolia"
173+
@vue:beforeMount="actuallyLoaded = true"
172174
/>
173175

174-
<div v-else id="docsearch">
176+
<div v-if="!actuallyLoaded" id="docsearch">
175177
<VPNavBarSearchButton :placeholder="buttonText" @click="load" />
176178
</div>
177179
</template>

0 commit comments

Comments
 (0)