Merge pull request #1022 from ulyssear/a11y-inert-content

Accessibility : Inert attribute for content outside of modal
This commit is contained in:
Peter Cottle 2022-10-10 11:36:11 -06:00 committed by GitHub
commit be8e52104b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -251,6 +251,11 @@ var ModalView = Backbone.View.extend({
},
show: function() {
Array.from(document.body.children).forEach(function(child) {
if (child.classList.contains('modalView')) return;
child.setAttribute('inert', '');
});
this.toggleZ(true);
// on reflow, change our class to animate. for whatever
// reason if this is done immediately, chrome might combine
@ -268,6 +273,12 @@ var ModalView = Backbone.View.extend({
this.toggleZ(false);
}
}.bind(this), this.getAnimationTime());
Array.from(document.body.children).forEach(function(child) {
if (child.classList.contains('modalView')) return;
child.removeAttribute('inert');
});
},
getInsideElement: function() {