Skip to content

Commit 0b1ce7e

Browse files
committed
feat: close module details panel on click outside
1 parent 0b6f062 commit 0b1ce7e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/devtools/src/app/components/flowmap/ModuleFlow.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import type { ModuleInfo, RolldownChunkInfo, RolldownModuleFlowNode, SessionContext } from '~~/shared/types'
3+
import { vOnClickOutside } from '@vueuse/components'
34
import { Pane, Splitpanes } from 'splitpanes'
45
import { shallowRef, toRefs, watch } from 'vue'
56
import ModuleFlowDetails from './ModuleFlowDetails.vue'
@@ -45,7 +46,7 @@ function handleClose() {
4546
<Pane v-if="selected" size="55" min-size="10" max-size="90" class="!h-auto !of-visible">
4647
<!-- the origin of the height: -->
4748
<!-- DialogTopMargin (20) + HandleHeight (30) + padding (4*2) = 58 -->
48-
<div w-full h="[calc(100vh-(var(--spacing)*58))]" sticky top-4>
49+
<div v-on-click-outside="[handleClose, { ignore: ['.splitpanes__splitter'] }]" w-full h="[calc(100vh-(var(--spacing)*58))]" sticky top-4>
4950
<div absolute left-0 top="1/2" translate-x="-1/2" translate-y="-1/2" bg="#DFDFDF dark:#313131" h-10 w-2 rounded-full z-10 cursor-col-resize />
5051
<ModuleFlowDetails
5152
:selected="selected"

0 commit comments

Comments
 (0)