fix(ui): Empty section headers do not obstruct interaction with elements above

2506-fix-frontend-regressions
Flupsi 2025-08-09 20:49:31 +02:00
rodzic 6f67998f98
commit 2e3d8755e4
1 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -1,6 +1,8 @@
<script setup lang="ts">
import type { ComponentProps } from 'vue-component-type-helpers'
import { computed } from 'vue'
import Layout from '~/components/ui/Layout.vue'
import Spacer from '~/components/ui/Spacer.vue'
import Button from '~/components/ui/Button.vue'
@ -20,6 +22,10 @@ const props = defineProps<{
[Operation in 'expand' | 'collapse']?: () => void
}>()
const hasContent = computed(() => {
// @ts-expect-error too complex type thingy
return Object.keys(props).some(key => (key === 'expand' || key === 'collapse' || key === 'action' || key.startsWith('h')) && props[key])
})
</script>
<template>
@ -37,13 +43,14 @@ const props = defineProps<{
<Layout
flex
no-gap
style="
:style="`
grid-column: 1 / -1;
align-self: baseline;
align-items: baseline;
position: relative;
flex-grow: 1;
"
${ hasContent ? '' : 'pointer-events: none;'}
`"
>
<!-- Accordion? -->
@ -101,7 +108,9 @@ const props = defineProps<{
/>
<Spacer grow />
</template>
<!-- Action! You can either specify `to` or `onClick`. -->
<component
:is="'to' in action ? Link : Button"
v-if="action"