@@ -498,19 +498,36 @@ export const BCarousel = /*#__PURE__*/ Vue.extend({
498
498
// Prev and next controls
499
499
let controls = h ( )
500
500
if ( this . controls ) {
501
+ const prevHandler = evt => {
502
+ /* istanbul ignore next */
503
+ if ( ! this . isSliding ) {
504
+ this . handleClick ( evt , this . prev )
505
+ } else {
506
+ evt . preventDefault ( )
507
+ }
508
+ }
509
+ const nextHandler = evt => {
510
+ /* istanbul ignore next */
511
+ if ( ! this . isSliding ) {
512
+ this . handleClick ( evt , this . next )
513
+ } else {
514
+ evt . preventDefault ( )
515
+ }
516
+ }
501
517
controls = [
502
518
h (
503
519
'a' ,
504
520
{
505
521
class : [ 'carousel-control-prev' ] ,
506
- attrs : { href : '#' , role : 'button' , 'aria-controls' : this . safeId ( '__BV_inner_' ) } ,
522
+ attrs : {
523
+ href : '#' ,
524
+ role : 'button' ,
525
+ 'aria-controls' : this . safeId ( '__BV_inner_' ) ,
526
+ 'aria-disabled' : this . isSliding ? 'true' : null
527
+ } ,
507
528
on : {
508
- click : evt => {
509
- this . handleClick ( evt , this . prev )
510
- } ,
511
- keydown : evt => {
512
- this . handleClick ( evt , this . prev )
513
- }
529
+ click : prevHandler ,
530
+ keydown : prevHandler
514
531
}
515
532
} ,
516
533
[
@@ -522,14 +539,15 @@ export const BCarousel = /*#__PURE__*/ Vue.extend({
522
539
'a' ,
523
540
{
524
541
class : [ 'carousel-control-next' ] ,
525
- attrs : { href : '#' , role : 'button' , 'aria-controls' : this . safeId ( '__BV_inner_' ) } ,
542
+ attrs : {
543
+ href : '#' ,
544
+ role : 'button' ,
545
+ 'aria-controls' : this . safeId ( '__BV_inner_' ) ,
546
+ 'aria-disabled' : this . isSliding ? 'true' : null
547
+ } ,
526
548
on : {
527
- click : evt => {
528
- this . handleClick ( evt , this . next )
529
- } ,
530
- keydown : evt => {
531
- this . handleClick ( evt , this . next )
532
- }
549
+ click : nextHandler ,
550
+ keydown : nextHandler
533
551
}
534
552
} ,
535
553
[
0 commit comments