Skip to content

Commit 53b44e4

Browse files
author
Juarez Mota
committed
fix: simplify focus management for DesignableBanner
The previous solution was displaying a ring around the focused components and messing with the css, an attempt to remove the ring only created more issues with the existing style.
1 parent 03260af commit 53b44e4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

dotcom-rendering/src/components/marketing/banners/designableBanner/DesignableBanner.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,8 @@ const DesignableBanner: ReactComponent<BannerRenderProps> = ({
140140
const bannerRef = useRef<HTMLDivElement>(null);
141141

142142
useEffect(() => {
143-
const firstInteractiveChoiceCard = bannerRef.current?.querySelector(
144-
'input',
145-
) as HTMLElement | null;
146-
if (firstInteractiveChoiceCard) {
147-
firstInteractiveChoiceCard.focus();
143+
if (bannerRef.current) {
144+
bannerRef.current.focus();
148145
}
149146
}, []);
150147

0 commit comments

Comments
 (0)