Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2020-06-04 10:41:47 +0300
committerXhmikosR <xhmikosr@gmail.com>2020-06-04 17:53:16 +0300
commit8bc6dcd280f096189214561b1f87f015cd2dcba1 (patch)
treefcda9b0cad8c9bd49f46a4b8d2e9119d5e7167bd /js/src
parent288b9b82b5a5cb64ec3aaadef13ac934a957e5d2 (diff)
Backport #30936
Add role="dialog" in modals via JavaScript
Diffstat (limited to 'js/src')
-rw-r--r--js/src/modal.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/js/src/modal.js b/js/src/modal.js
index 7338ffd376..f898d0c465 100644
--- a/js/src/modal.js
+++ b/js/src/modal.js
@@ -265,6 +265,7 @@ class Modal {
this._element.style.display = 'block'
this._element.removeAttribute('aria-hidden')
this._element.setAttribute('aria-modal', true)
+ this._element.setAttribute('role', 'dialog')
if ($(this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {
modalBody.scrollTop = 0
@@ -344,6 +345,7 @@ class Modal {
this._element.style.display = 'none'
this._element.setAttribute('aria-hidden', true)
this._element.removeAttribute('aria-modal')
+ this._element.removeAttribute('role')
this._isTransitioning = false
this._showBackdrop(() => {
$(document.body).removeClass(CLASS_NAME_OPEN)