From: Patrick H. Lauke Date: Tue, 10 May 2016 22:53:49 +0000 (+0100) Subject: Handle aria-hidden on modal container when showing/hiding X-Git-Tag: v4.0.0-alpha.3~86^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b107e3342a761aa94b7827436264469d5630eaec;p=thirdparty%2Fbootstrap.git Handle aria-hidden on modal container when showing/hiding Fixes #19878 --- diff --git a/js/src/modal.js b/js/src/modal.js index e2365aca79..695ac569b8 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -223,6 +223,7 @@ const Modal = (($) => { } this._element.style.display = 'block' + this._element.removeAttribute('aria-hidden') this._element.scrollTop = 0 if (transition) { @@ -290,6 +291,7 @@ const Modal = (($) => { _hideModal() { this._element.style.display = 'none' + this._element.setAttribute('aria-hidden', 'true') this._showBackdrop(() => { $(document.body).removeClass(ClassName.OPEN) this._resetAdjustments() diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index f3297641bd..28c1e0ec74 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -233,6 +233,23 @@ $(function () { .bootstrapModal('show') }) + QUnit.test('should remove aria-hidden attribute when shown, add it back when hidden', function (assert) { + assert.expect(3) + var done = assert.async() + + $('