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