File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { slides } from '#slidev/slides'
55import { clamp } from '@antfu/utils'
66import { parseRangeString } from '@slidev/parser/utils'
77import { createSharedComposable } from '@vueuse/core'
8+ import { hideAllPoppers } from 'floating-vue'
89import { computed , ref , watch } from 'vue'
910import { useRoute , useRouter } from 'vue-router'
1011import { CLICKS_MAX } from '../constants'
@@ -118,6 +119,8 @@ export function useNavBase(
118119
119120 watch ( currentSlideRoute , ( next , prev ) => {
120121 navDirection . value = next . no - prev . no
122+ if ( prev )
123+ hideAllPoppers ( )
121124 } )
122125
123126 async function openInEditor ( url ?: string ) {
Original file line number Diff line number Diff line change 11<script setup lang="ts">
22import type { SlideRoute } from ' @slidev/types'
33import { GlobalBottom , GlobalTop } from ' #slidev/global-layers'
4- import { recomputeAllPoppers } from ' floating-vue'
4+ import { hideAllPoppers , recomputeAllPoppers } from ' floating-vue'
55import { computed , shallowRef , TransitionGroup , watchEffect } from ' vue'
66import { createFixedClicks } from ' ../composables/useClicks'
77import { useNav } from ' ../composables/useNav'
@@ -39,12 +39,18 @@ watchEffect(() => {
3939 preloadRoute (currentSlideRoute .value )
4040 preloadRoute (prevRoute .value )
4141 preloadRoute (nextRoute .value )
42+ setTimeout (() => {
43+ hideAllPoppers ()
44+ }, 150 )
4245})
4346// preload all slides after 3s
4447watchEffect ((onCleanup ) => {
4548 const routes = slides .value
4649 const timeout = setTimeout (() => {
4750 routes .forEach (preloadRoute )
51+ setTimeout (() => {
52+ hideAllPoppers ()
53+ }, 150 )
4854 }, 3000 )
4955 onCleanup (() => clearTimeout (timeout ))
5056})
You can’t perform that action at this time.
0 commit comments