1
1
import * as React from 'react' ;
2
2
3
- import { PopoverControlled as Popover } from '@/components/popover' ;
3
+ import { PopoverControlled as Popover , PopoverComponentType } from '@/components/popover' ;
4
4
import { STYLES_NAME } from '@/constants' ;
5
5
import { useDeviceHeight , useId , useMediaDevice , useScrollEffect } from '@/hooks' ;
6
6
import { useStyles } from '@/hooks/useStyles/useStyles' ;
7
7
import { ErrorBoundary , FallbackComponent } from '@/provider/errorBoundary' ;
8
- import { DeviceBreakpointsType } from '@/types' ;
8
+ import { DeviceBreakpointsType , ROLES } from '@/types' ;
9
9
10
10
import { ActionBottomSheetStandAlone } from './actionBottomSheetStandAlone' ;
11
11
import {
@@ -85,7 +85,7 @@ const ActionBottomSheetControlledComponent = React.forwardRef(
85
85
ref : React . ForwardedRef < HTMLDivElement > | undefined | null
86
86
) : JSX . Element => {
87
87
const uniqueTitleId = useId ( 'actionSheet-title' ) ;
88
- const titleId = title ?. id ?? uniqueTitleId ;
88
+ const titleId = ( title ?. id ?? title ?. content ) ? uniqueTitleId : undefined ;
89
89
const styles = useStyles < ActionBottomSheetVariantStylesType > (
90
90
STYLES_NAME . ACTION_BOTTOM_SHEET ,
91
91
props . variant ,
@@ -95,10 +95,13 @@ const ActionBottomSheetControlledComponent = React.forwardRef(
95
95
return (
96
96
< Popover
97
97
aria-labelledby = { titleId }
98
+ aria-modal = { true }
98
99
clickOverlayClose = { ! blocked }
100
+ component = { PopoverComponentType . DIV }
99
101
dataTestId = { `${ props . dataTestId } Popover` }
100
102
hasBackDrop = { true }
101
103
open = { open }
104
+ role = { ROLES . DIALOG }
102
105
trapFocusInsideModal = { true }
103
106
variant = { styles . popoverVariant }
104
107
{ ...popover }
0 commit comments