File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -422,15 +422,17 @@ export const BModal = /*#__PURE__*/ Vue.extend({
422422 }
423423 } ,
424424 computedModalAttrs ( ) {
425+ const { isVisible, ariaLabel } = this
426+
425427 return {
426428 id : this . modalId ,
427429 role : 'dialog' ,
428- 'aria-hidden' : this . isVisible ? null : 'true' ,
429- 'aria-modal' : this . isVisible ? 'true' : null ,
430- 'aria-label' : this . ariaLabel ,
430+ 'aria-hidden' : isVisible ? null : 'true' ,
431+ 'aria-modal' : isVisible ? 'true' : null ,
432+ 'aria-label' : ariaLabel ,
431433 'aria-labelledby' :
432434 this . hideHeader ||
433- this . ariaLabel ||
435+ ariaLabel ||
434436 // TODO: Rename slot to `title` and deprecate `modal-title`
435437 ! ( this . hasNormalizedSlot ( 'modal-title' ) || this . titleHtml || this . title )
436438 ? null
@@ -994,7 +996,6 @@ export const BModal = /*#__PURE__*/ Vue.extend({
994996 staticClass : 'modal-content' ,
995997 class : this . contentClass ,
996998 attrs : {
997- role : 'document' ,
998999 id : this . modalContentId ,
9991000 tabindex : '-1'
10001001 }
Original file line number Diff line number Diff line change @@ -74,8 +74,6 @@ describe('modal', () => {
7474 expect ( $content . exists ( ) ) . toBe ( true )
7575 expect ( $content . attributes ( 'tabindex' ) ) . toBeDefined ( )
7676 expect ( $content . attributes ( 'tabindex' ) ) . toEqual ( '-1' )
77- expect ( $content . attributes ( 'role' ) ) . toBeDefined ( )
78- expect ( $content . attributes ( 'role' ) ) . toEqual ( 'document' )
7977
8078 wrapper . destroy ( )
8179 } )
@@ -158,8 +156,6 @@ describe('modal', () => {
158156 expect ( $content . exists ( ) ) . toBe ( true )
159157 expect ( $content . attributes ( 'tabindex' ) ) . toBeDefined ( )
160158 expect ( $content . attributes ( 'tabindex' ) ) . toEqual ( '-1' )
161- expect ( $content . attributes ( 'role' ) ) . toBeDefined ( )
162- expect ( $content . attributes ( 'role' ) ) . toEqual ( 'document' )
163159
164160 wrapper . destroy ( )
165161 } )
You can’t perform that action at this time.
0 commit comments