Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ModalManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ModalManager {
this.modals.push(modal);

if (this.hideSiblingNodes) {
hideSiblings(container, modal.mountNode);
hideSiblings(container, modal.modalNode);
}

if (containerIdx !== -1) {
Expand Down Expand Up @@ -131,14 +131,14 @@ class ModalManager {
}

if (this.hideSiblingNodes) {
showSiblings(container, modal.mountNode);
showSiblings(container, modal.modalNode);
}
this.containers.splice(containerIdx, 1);
this.data.splice(containerIdx, 1);
}
else if (this.hideSiblingNodes) {
//otherwise make sure the next top modal is visible to a SR
ariaHidden(false, data.modals[data.modals.length - 1].mountNode);
ariaHidden(false, data.modals[data.modals.length - 1].modalNode);
}
}

Expand Down
13 changes: 12 additions & 1 deletion test/ModalManagerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ describe('ModalManager', ()=> {
expect(app.getAttribute('aria-hidden')).to.equal('true');
});

it('should not add aria-hidden to modal', ()=>{
let modal = new Modal({});
let mount = document.createElement('div');

modal.modalNode = mount;
container.appendChild(mount);
manager.add(modal, container);

expect(mount.getAttribute('aria-hidden')).to.equal(null);
});

it('should add aria-hidden to previous modals', ()=>{
let modalA = new Modal({});
let mount = document.createElement('div');
Expand All @@ -129,7 +140,7 @@ describe('ModalManager', ()=> {
let modalB = new Modal({});
let mount = document.createElement('div');

modalA.mountNode = mount;
modalA.modalNode = mount;
container.appendChild(mount);

manager.add(modalA, container);
Expand Down