Skip to content

Commit

Permalink
fix: Twoslash popover not shown in print mode (#1445)
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Mar 19, 2024
1 parent 870ee8a commit a08d244
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/client/internals/SlidesShow.vue
Expand Up @@ -75,6 +75,7 @@ function onAfterLeave() {
class="overflow-hidden"
/>
</div>
<div id="twoslash-container" />
</component>

<!-- Global Top -->
Expand Down
8 changes: 7 additions & 1 deletion packages/client/pages/print.vue
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { watchEffect } from 'vue'
import { onMounted, watchEffect } from 'vue'
import { recomputeAllPoppers } from 'floating-vue'
import { windowSize } from '../state'
import PrintContainer from '../internals/PrintContainer.vue'
import PrintStyle from '../internals/PrintStyle.vue'
Expand All @@ -13,6 +14,10 @@ watchEffect(() => {
else
(document.body.parentNode as HTMLElement).classList.remove('print')
})
onMounted(() => {
recomputeAllPoppers()
})
</script>

<template>
Expand All @@ -24,6 +29,7 @@ watchEffect(() => {
:width="windowSize.width.value"
/>
</div>
<div id="twoslash-container" />
</template>

<style lang="postcss">
Expand Down
2 changes: 1 addition & 1 deletion packages/client/setup/main.ts
Expand Up @@ -35,7 +35,7 @@ export default async function setupMain(app: App) {
app.use(createVClickDirectives())
app.use(createVMarkDirective())
app.use(MotionPlugin)
app.use(TwoSlashFloatingVue as any, { container: '#slideshow' })
app.use(TwoSlashFloatingVue as any, { container: '#twoslash-container' })

const context: AppContext = {
app,
Expand Down

0 comments on commit a08d244

Please sign in to comment.