File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
dotcom-rendering/src/components/marketing/banners/designableBanner Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import type {
23
23
Image ,
24
24
} from '@guardian/support-dotcom-components/dist/shared/types' ;
25
25
import type { ChoiceCard } from '@guardian/support-dotcom-components/dist/shared/types/props/choiceCards' ;
26
- import { useEffect , useState } from 'react' ;
26
+ import { useEffect , useRef , useState } from 'react' ;
27
27
import {
28
28
removeMediaRulePrefix ,
29
29
useMatchMedia ,
@@ -137,6 +137,14 @@ const DesignableBanner: ReactComponent<BannerRenderProps> = ({
137
137
) ;
138
138
} , [ ] ) ;
139
139
140
+ const bannerRef = useRef < HTMLDivElement > ( null ) ;
141
+
142
+ useEffect ( ( ) => {
143
+ if ( bannerRef . current ) {
144
+ bannerRef . current . focus ( ) ;
145
+ }
146
+ } , [ ] ) ;
147
+
140
148
useEffect ( ( ) => {
141
149
if ( iosAppBannerPresent ) {
142
150
// send ophan event
@@ -275,6 +283,9 @@ const DesignableBanner: ReactComponent<BannerRenderProps> = ({
275
283
276
284
return (
277
285
< div
286
+ ref = { bannerRef }
287
+ role = "alert"
288
+ tabIndex = { - 1 }
278
289
css = { styles . outerContainer (
279
290
templateSettings . containerSettings . backgroundColour ,
280
291
iosAppBannerPresent ,
You can’t perform that action at this time.
0 commit comments