diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Lists/Carousel/BitCarousel.razor b/src/BlazorUI/Bit.BlazorUI/Components/Lists/Carousel/BitCarousel.razor index 327d693cdaa..1533e72aa63 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Lists/Carousel/BitCarousel.razor +++ b/src/BlazorUI/Bit.BlazorUI/Components/Lists/Carousel/BitCarousel.razor @@ -3,17 +3,76 @@
+ dir="@Dir?.ToString().ToLower()" + tabindex="@((NoKeyboard || IsEnabled is false) ? null : (TabIndex ?? "0"))" + @onkeydown="HandleKeyDown" + @onfocusin="HandleFocusIn" + @onfocusout="HandleFocusOut" + @onmouseenter="HandleMouseEnter" + @onmouseleave="HandleMouseLeave"> + + @* The controls are rendered before the slides so the play/pause button is the first thing the keyboard + reaches, which is what the carousel pattern of the ARIA authoring practices asks of a carousel that + moves on its own: the motion can be stopped before anything else is dealt with. The stylesheet puts + the row back below the slides, so nothing about the way the carousel looks changes with it. *@ + @if ((HideDots is false && _pagesCount > 1) || (AutoPlay && ShowPlayPause)) + { +
+ @if (AutoPlay && ShowPlayPause) + { + var playPauseIcon = IsPaused + ? BitIconInfo.From(PlayIcon, PlayIconName ?? "Play") + : BitIconInfo.From(PauseIcon, PauseIconName ?? "Pause"); +