mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-15 17:52:19 +03:00
Add some comments explaining how we are using aria-hidden property to
hide content outside of the BaseDialog to screen reader users.
This commit is contained in:
parent
f9b0243c8e
commit
4171675221
1 changed files with 5 additions and 0 deletions
|
@ -50,14 +50,19 @@ export default React.createClass({
|
|||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
// Retrieve the root node of the Riot application outside the dialog
|
||||
this.applicationNode = document.getElementById('matrixchat');
|
||||
if (this.applicationNode) {
|
||||
// Hide the content outside the dialog to screen reader users
|
||||
// so they won't be able to navigate into it and act on it using
|
||||
// screen reader specific features
|
||||
this.applicationNode.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
if (this.applicationNode) {
|
||||
// When dismissing the dialog, make all of Riot available to screen reader users again
|
||||
this.applicationNode.setAttribute('aria-hidden', 'false');
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue