@@ -109,8 +109,16 @@ export default function TripPattern({
109109 < div ref = { ref } className = { style . tripPatternContainer } >
110110 < motion . div
111111 id = { `${ id } -details-region` }
112- role = "region"
112+ role = "button"
113+ tabIndex = { 0 }
113114 onClick = { ( ) => setIsOpen ( ! isOpen ) }
115+ onKeyDown = { ( e ) => {
116+ if ( e . key === 'Enter' || e . key === ' ' ) {
117+ e . preventDefault ( ) ;
118+ setIsOpen ( ! isOpen ) ;
119+ }
120+ } }
121+ aria-expanded = { isOpen }
114122 className = { className }
115123 data-testid = { testId }
116124 initial = { { opacity : 0 , x : - 10 } }
@@ -119,14 +127,14 @@ export default function TripPattern({
119127 transition = { {
120128 delay, // staggerChildren on parent only works first render
121129 } }
122- aria-label = { tripSummary (
130+ aria-label = { ` ${ tripSummary (
123131 tripPattern ,
124132 t ,
125133 language ,
126134 tripIsInPast ,
127135 index + 1 ,
128136 isCancelled ,
129- ) }
137+ ) } . ${ isOpen ? t ( PageText . Assistant . trip . tripPattern . activateToCollapse ) : t ( PageText . Assistant . trip . tripPattern . activateToExpand ) } ` }
130138 >
131139 < TripPatternHeader
132140 tripPattern = { tripPattern }
@@ -243,7 +251,7 @@ export default function TripPattern({
243251 </ Typo . span >
244252 </ div >
245253 </ div >
246- < footer className = { style . footer } onClick = { ( ) => setIsOpen ( ! isOpen ) } >
254+ < footer className = { style . footer } >
247255 < div className = { style . info__container } >
248256 { tripIsInPast && (
249257 < Tag
@@ -273,8 +281,8 @@ export default function TripPattern({
273281 : t ( PageText . Assistant . trip . tripPattern . seeMore )
274282 }
275283 buttonProps = { {
276- 'aria-controls' : ` ${ id } -details-region` ,
277- 'aria-expanded ' : isOpen ,
284+ tabIndex : - 1 ,
285+ 'aria-hidden ' : true ,
278286 } }
279287 className = { style . seeMoreButton }
280288 size = { 'pill' }
0 commit comments