File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/components/SlidingPane Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1- import React from 'react' ;
1+ import React , { useId } from 'react' ;
22import classNames from 'classnames' ;
33import ExitIcon from '@moda/icons/exit-16' ;
44import { FocusOn } from 'react-focus-on' ;
@@ -24,6 +24,8 @@ export const SlidingPane: React.FC<SlidingPaneProps> = ({
2424 autoFocus = true ,
2525 ...rest
2626} ) => {
27+ const titleId = useId ( ) ;
28+
2729 return (
2830 < >
2931 < div
@@ -40,6 +42,9 @@ export const SlidingPane: React.FC<SlidingPaneProps> = ({
4042 onEscapeKey = { onClose }
4143 >
4244 < div
45+ role = 'dialog'
46+ aria-modal = 'true'
47+ aria-labelledby = { titleId }
4348 className = { classNames ( 'SlidingPane' , className , {
4449 'SlidingPane--active' : visible
4550 } ) }
@@ -51,7 +56,7 @@ export const SlidingPane: React.FC<SlidingPaneProps> = ({
5156 direction = 'horizontal'
5257 className = 'SlidingPane__top'
5358 >
54- < Text treatment = 'h5' family = 'serif' >
59+ < Text id = { titleId } treatment = 'h5' family = 'serif' >
5560 { title }
5661 </ Text >
5762 < Clickable className = 'SlidingPane__close' aria-label = 'Close' onClick = { onClose } >
You can’t perform that action at this time.
0 commit comments