Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

552 fix #583

Closed
wants to merge 10 commits into from
4 changes: 4 additions & 0 deletions examples/dialog-modal/css/dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ body:not(.toc-inline) {
padding: 1.6em 0 2em;
}

.dialog-active #base_window_layer {
user-select: none;
}

#base_window_layer main, #base_window_layer nav {
max-width: 50em;
margin: auto;
Expand Down
6 changes: 6 additions & 0 deletions examples/dialog-modal/js/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ aria.Utils = aria.Utils || {};
'Dialog() requires a DOM element with ARIA role of dialog.');
}

document.body.classList.add('dialog-active');

// Wrap in an individual backdrop element if one doesn't exist
// Native <dialog> elements use the ::backdrop pseudo-element, which
// works similarly.
Expand Down Expand Up @@ -292,6 +294,10 @@ aria.Utils = aria.Utils || {};
if (topDialog.dialogNode.contains(closeButton)) {
topDialog.close();
}

if (!aria.OpenDialogList.length) {
document.body.classList.remove('dialog-active');
}
}; // end closeDialog

window.replaceDialog = function (newDialogId, newFocusAfterClosed,
Expand Down