You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Move aria-hidden management from the BaseDialog component to the Modal
This commit is contained in:
14
src/Modal.js
14
src/Modal.js
@@ -186,11 +186,25 @@ class ModalManager {
|
||||
}
|
||||
|
||||
_reRender() {
|
||||
// Retrieve the root node of the Riot application outside the modal
|
||||
let applicationNode = document.getElementById('matrixchat');
|
||||
if (this._modals.length == 0) {
|
||||
if (applicationNode) {
|
||||
// If there is no modal to render, make all of Riot available
|
||||
// to screen reader users again
|
||||
applicationNode.setAttribute('aria-hidden', 'false');
|
||||
}
|
||||
ReactDOM.unmountComponentAtNode(this.getOrCreateContainer());
|
||||
return;
|
||||
}
|
||||
|
||||
if (applicationNode) {
|
||||
// Hide the content outside the modal to screen reader users
|
||||
// so they won't be able to navigate into it and act on it using
|
||||
// screen reader specific features
|
||||
applicationNode.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
|
||||
const modal = this._modals[0];
|
||||
const dialog = (
|
||||
<div className={"mx_Dialog_wrapper " + (modal.className ? modal.className : '')}>
|
||||
|
||||
Reference in New Issue
Block a user