@@ -16,6 +16,7 @@ type Props = {
1616 sectionId ?: string ;
1717 shouldStackCards ?: { desktop : boolean ; mobile : boolean } ;
1818 gapSizes ?: GapSizes ;
19+ isBelowTabletBreakpoint ?: boolean ;
1920} ;
2021
2122/**
@@ -234,6 +235,7 @@ export const ScrollableCarousel = ({
234235 sectionId,
235236 shouldStackCards = { desktop : false , mobile : false } ,
236237 gapSizes = { column : 'large' , row : 'large' } ,
238+ isBelowTabletBreakpoint = false ,
237239} : Props ) => {
238240 const carouselRef = useRef < HTMLOListElement | null > ( null ) ;
239241 const [ previousButtonEnabled , setPreviousButtonEnabled ] = useState ( false ) ;
@@ -369,7 +371,7 @@ export const ScrollableCarousel = ({
369371
370372 return (
371373 < div css = { containerStyles } >
372- < ol
374+ < ul
373375 ref = { carouselRef }
374376 css = { [
375377 carouselStyles ,
@@ -383,9 +385,15 @@ export const ScrollableCarousel = ({
383385 ] }
384386 data-heatphan-type = "carousel"
385387 onFocus = { scrollToCardOnFocus }
388+ { ...( isBelowTabletBreakpoint && {
389+ role : 'region' ,
390+ 'aria-roledescription' : 'carousel' ,
391+ 'aria-labelledby' : `${ sectionId } -title` ,
392+ 'aria-live' : 'polite' ,
393+ } ) }
386394 >
387395 { children }
388- </ ol >
396+ </ ul >
389397
390398 { showNavigation && (
391399 < CarouselNavigationButtons
@@ -412,10 +420,12 @@ ScrollableCarousel.Item = ({
412420 isStackingCarousel = false ,
413421 children,
414422 borderColour = palette ( '--card-border-top' ) ,
423+ isBelowTabletBreakpoint = false ,
415424} : {
416425 isStackingCarousel ?: boolean ;
417426 children : React . ReactNode ;
418427 borderColour ?: string ;
428+ isBelowTabletBreakpoint ?: boolean ;
419429} ) => (
420430 < li
421431 css = { [
@@ -424,6 +434,10 @@ ScrollableCarousel.Item = ({
424434 ? stackedRowLeftBorderStyles ( borderColour )
425435 : singleRowLeftBorderStyles ( borderColour ) ,
426436 ] }
437+ { ...( isBelowTabletBreakpoint && {
438+ role : 'group' ,
439+ 'aria-roledescription' : 'slide' ,
440+ } ) }
427441 >
428442 { children }
429443 </ li >
0 commit comments