1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-09 15:16:51 +02:00

Add aria-modal to modals (#27780)

Dynamically set/remove `aria-modal="true"` when a modal is shown/hidden
This commit is contained in:
Patrick H. Lauke
2018-12-05 18:58:09 +00:00
committed by XhmikosR
parent 8fb6e84fa0
commit 6c00dd08bc
2 changed files with 19 additions and 0 deletions

View File

@@ -243,6 +243,7 @@ class Modal {
this._element.style.display = 'block'
this._element.removeAttribute('aria-hidden')
this._element.setAttribute('aria-modal', true)
this._element.scrollTop = 0
if (transition) {
@@ -314,6 +315,7 @@ class Modal {
_hideModal() {
this._element.style.display = 'none'
this._element.setAttribute('aria-hidden', true)
this._element.removeAttribute('aria-modal')
this._isTransitioning = false
this._showBackdrop(() => {
$(document.body).removeClass(ClassName.OPEN)