Skip to content

Commit c402573

Browse files
author
Kubit
committed
Add PopoverComponentType to ActionBottomSheet interface
1 parent 8098704 commit c402573

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/actionBottomSheet/actionBottomSheetControlled.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as React from 'react';
22

3-
import { PopoverControlled as Popover } from '@/components/popover';
3+
import { PopoverControlled as Popover, PopoverComponentType } from '@/components/popover';
44
import { STYLES_NAME } from '@/constants';
55
import { useDeviceHeight, useId, useMediaDevice, useScrollEffect } from '@/hooks';
66
import { useStyles } from '@/hooks/useStyles/useStyles';
77
import { ErrorBoundary, FallbackComponent } from '@/provider/errorBoundary';
8-
import { DeviceBreakpointsType } from '@/types';
8+
import { DeviceBreakpointsType, ROLES } from '@/types';
99

1010
import { ActionBottomSheetStandAlone } from './actionBottomSheetStandAlone';
1111
import {
@@ -85,7 +85,7 @@ const ActionBottomSheetControlledComponent = React.forwardRef(
8585
ref: React.ForwardedRef<HTMLDivElement> | undefined | null
8686
): JSX.Element => {
8787
const uniqueTitleId = useId('actionSheet-title');
88-
const titleId = title?.id ?? uniqueTitleId;
88+
const titleId = (title?.id ?? title?.content) ? uniqueTitleId : undefined;
8989
const styles = useStyles<ActionBottomSheetVariantStylesType>(
9090
STYLES_NAME.ACTION_BOTTOM_SHEET,
9191
props.variant,
@@ -95,10 +95,13 @@ const ActionBottomSheetControlledComponent = React.forwardRef(
9595
return (
9696
<Popover
9797
aria-labelledby={titleId}
98+
aria-modal={true}
9899
clickOverlayClose={!blocked}
100+
component={PopoverComponentType.DIV}
99101
dataTestId={`${props.dataTestId}Popover`}
100102
hasBackDrop={true}
101103
open={open}
104+
role={ROLES.DIALOG}
102105
trapFocusInsideModal={true}
103106
variant={styles.popoverVariant}
104107
{...popover}

0 commit comments

Comments
 (0)