@@ -300,16 +300,8 @@ export default class SdCarousel extends SolidElement {
300300 this . requestUpdate ( ) ;
301301 } ;
302302
303- private handleFocus ( ) {
304- if ( this . autoplay ) {
305- this . scrollContainer . setAttribute ( 'aria-live' , 'polite' ) ;
306- }
307- }
308-
309- private handleBlur ( ) {
310- if ( this . autoplay ) {
311- this . scrollContainer . setAttribute ( 'aria-live' , 'off' ) ;
312- }
303+ private get isAutoPlaying ( ) : boolean {
304+ return this . autoplay && ! this . pausedAutoplay && ! this . autoplayController . paused ;
313305 }
314306
315307 private unblockAutoplay = ( e : MouseEvent , button : HTMLButtonElement ) => {
@@ -620,17 +612,16 @@ export default class SdCarousel extends SolidElement {
620612 : `grid overflow-auto overscroll-x-contain grid-flow-col auto-rows-[100%] snap-x snap-mandatory overflow-y-hidden`
621613 ) } "
622614 style = "--slides-per-page: ${ this . slidesPerPage } ;"
615+ role = "group"
623616 aria-busy = "${ scrollController . scrolling ? 'true' : 'false' } "
624617 aria-label = "${ this . localize . term (
625618 'carouselContainer' ,
626619 Array . from ( this . slides ) . filter ( el => ! el . hasAttribute ( 'data-clone' ) ) . length
627620 ) } "
628- aria-live = ${ this . autoplay ? 'off' : 'polite' }
621+ aria-live = ${ this . isAutoPlaying ? 'off' : 'polite' }
629622 tabindex= "0"
630623 @keydown = ${ this . handleKeyDown }
631624 @scrollend = ${ this . handleScrollEnd }
632- @focus = ${ this . handleFocus }
633- @blur = ${ this . handleBlur }
634625 >
635626 <slot> </ slot>
636627 </ div>
@@ -649,8 +640,6 @@ export default class SdCarousel extends SolidElement {
649640 aria- label= "${ this . localize . term ( 'previousSlide' ) } "
650641 aria-controls = "scroll-container"
651642 aria-disabled = "${ prevEnabled ? 'false' : 'true' } "
652- @focus = ${ this . handleFocus }
653- @blur = ${ this . handleBlur }
654643 @click = ${ prevEnabled
655644 ? ( e : MouseEvent ) => {
656645 this . previous ( ) ;
@@ -754,8 +743,6 @@ export default class SdCarousel extends SolidElement {
754743 aria- label= "${ this . localize . term ( 'nextSlide' ) } "
755744 aria- controls= "scroll- container"
756745 aria- dis abled= "${ nextEnabled ? 'false' : 'true' } "
757- @focus = ${ this . handleFocus }
758- @blur = ${ this . handleBlur }
759746 @click = ${ nextEnabled
760747 ? ( e : MouseEvent ) => {
761748 this . next ( ) ;
0 commit comments