File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
22import type { DrawerEmits , DrawerProps } from ' .'
3+ import { VisuallyHidden } from ' reka-ui'
34import { cn } from ' @/utils'
45import {
56 Sheet ,
@@ -42,6 +43,12 @@ const props = withDefaults(
4243
4344const emits = defineEmits <DrawerEmits >()
4445
46+ const slots = defineSlots <{
47+ header? : () => VNode
48+ default? : () => VNode
49+ footer? : () => VNode
50+ }>()
51+
4552const drawerId = shallowRef (props .id ?? useId ())
4653const isOpen = ref (props .modelValue )
4754
@@ -185,6 +192,10 @@ function handleAnimationEnd() {
185192 'border-b': props.bordered,
186193 })"
187194 >
195+ <VisuallyHidden v-if =" !!slots.header" >
196+ <SheetTitle />
197+ <SheetDescription />
198+ </VisuallyHidden >
188199 <slot name =" header" >
189200 <SheetTitle :class =" { 'text-center': props.centered }" >
190201 {{ title }}
@@ -194,8 +205,12 @@ function handleAnimationEnd() {
194205 </SheetDescription >
195206 </slot >
196207 </SheetHeader >
208+ <VisuallyHidden v-else >
209+ <SheetTitle />
210+ <SheetDescription />
211+ </VisuallyHidden >
197212 <div class =" m-0 flex-1 of-y-hidden" >
198- <FaScrollArea class =" h-full" >
213+ <FaScrollArea v-if = " !!slots.default " class =" h-full" >
199214 <div class =" p-4" >
200215 <slot />
201216 </div >
Original file line number Diff line number Diff line change @@ -269,6 +269,10 @@ function handleAnimationEnd() {
269269 </DialogDescription >
270270 </slot >
271271 </DialogHeader >
272+ <VisuallyHidden v-else >
273+ <DialogTitle />
274+ <DialogDescription />
275+ </VisuallyHidden >
272276 <FaScrollArea v-if =" !!slots.default" ref =" dialogAreaRef" class =" flex-1" >
273277 <div :class =" cn('min-h-40 p-4', props.contentClass)" >
274278 <slot />
You can’t perform that action at this time.
0 commit comments