Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DockingPanel clickoutside on iframe #211

Merged
merged 1 commit into from May 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 18 additions & 2 deletions packages/devtools/client/components/SideNav.vue
@@ -1,19 +1,35 @@
<script setup lang="ts">
const client = useClient()
const categories = useCategorizedTabs()

const show = ref(true)
const panel = ref()

onClickOutside(panel, () => {
show.value = false
}, {
detectIframe: true,
})
</script>

<template>
<div border="r base" flex="~ col" z-100 h-full items-center of-hidden bg-base>
<div flex="~ none col items-center">
<VDropdown placement="left-start" :distance="20">
<VDropdown
placement="left-start"
:distance="20"
:triggers="[]"
:shown="show"
:auto-hide="false"
>
<button
i-logos-nuxt-icon my3 h-6 w-6 pb-2 text-lg
:class="client ? '' : 'saturate-0'"
:title="client ? 'Nuxt DevTools' : 'DevTools Client not connected, try open it in iframe mode'"
@click="show = !show"
/>
<template #popper>
<DockingPanel />
<DockingPanel ref="panel" />
</template>
</VDropdown>
<div h-1px w-8 border="b base" />
Expand Down