Skip to content

Commit

Permalink
Change the order of button group so that it can be focused before
Browse files Browse the repository at this point in the history
falling into iframes
  • Loading branch information
hanbyul-here committed Nov 16, 2023
1 parent 872a70c commit 831634f
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions overrides/common/embedded-video-carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const ButtonGroup = styled.div`
top: calc(${(props) => props.topHeight}px + ${glsp(4)});
left: unset;
align-items: center;
z-index: 5;
`;

const buttonStyle = createButtonStyles({
Expand Down Expand Up @@ -128,6 +129,30 @@ export default function Carousel({ items }: EmbeddedVideosPropType) {
totalSlides={items.length}
style={{ gridColumn: "1 / -1", gridRow: "2", position: "relative" }}
>
{items.length > 1 && (
<ButtonGroup
topHeight={height}
role="group"
aria-label="Slide controls"
>
<ButtonBackStyled>
<CollecticonChevronLeft title="Go to previous slide" meaningful />
</ButtonBackStyled>
{/* A workaround to show current slide number/ total slide number */}
<DotGroup
renderDots={(props) => {
return (
<span>
{props.currentSlide + 1}/{items.length + 1}
</span>
);
}}
/>
<ButtonNextStyled>
<CollecticonChevronRight title="Go to next slide" meaningful />
</ButtonNextStyled>
</ButtonGroup>
)}
<div role="region" aria-label="Carousel">
<FeaturedList>
<Slider>
Expand All @@ -151,38 +176,13 @@ export default function Carousel({ items }: EmbeddedVideosPropType) {
<p>{t.caption}</p>
</DescWrapper>
</Slide>
<SROnly id={`carousel-item-${idx}__label`}>{t.title}</SROnly>
<SROnly id={`carousel-item-${idx}__label`} aria-live="polite">
{t.title}
</SROnly>
</FeaturedContent>
))}
</Slider>
</FeaturedList>
{items.length > 1 && (
<ButtonGroup
topHeight={height}
role="group"
aria-label="Slide controls"
>
<ButtonBackStyled>
<CollecticonChevronLeft
title="Go to previous slide"
meaningful
/>
</ButtonBackStyled>
{/* A workaround to show current slide number/ total slide number */}
<DotGroup
renderDots={(props) => {
return (
<span>
{props.currentSlide + 1}/{items.length + 1}
</span>
);
}}
/>
<ButtonNextStyled>
<CollecticonChevronRight title="Go to next slide" meaningful />
</ButtonNextStyled>
</ButtonGroup>
)}
</div>
</CarouselProvider>
</Lazyload>
Expand Down

0 comments on commit 831634f

Please sign in to comment.