Skip to content
Snippets Groups Projects
Commit 634b71ed authored by Sorin Davidoi's avatar Sorin Davidoi Committed by Eugen Rochko
Browse files

Accessability fixes (#4432)

* fix(modal_root): Read type from props, not from component

* fix(status_list): Do not user event.path
parent 3d378ed0
No related branches found
No related tags found
No related merge requests found
......@@ -109,9 +109,9 @@ export default class StatusList extends ImmutablePureComponent {
const article = (() => {
switch (e.key) {
case 'PageDown':
return e.nativeEvent.path[0].nodeName === 'ARTICLE' && e.nativeEvent.path[0].nextElementSibling;
return e.target.nodeName === 'ARTICLE' && e.target.nextElementSibling;
case 'PageUp':
return e.nativeEvent.path[0].nodeName === 'ARTICLE' && e.nativeEvent.path[0].previousElementSibling;
return e.target.nodeName === 'ARTICLE' && e.target.previousElementSibling;
case 'End':
return this.node.querySelector('[role="feed"] > article:last-of-type');
case 'Home':
......
......@@ -53,7 +53,7 @@ export default class ModalRoot extends React.PureComponent {
}
componentDidUpdate (prevProps) {
if (!this.type && !!prevProps.type) {
if (!this.props.type && !!prevProps.type) {
this.getSiblings().forEach(sibling => sibling.removeAttribute('inert'));
this.activeElement.focus();
this.activeElement = null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment