Accessability fixes (#4432)

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

* fix(status_list): Do not user event.path
signup-info-prompt
Sorin Davidoi 2017-07-28 22:55:19 +02:00 committed by Eugen Rochko
parent 3d378ed0b4
commit 634b71ed1d
2 changed files with 3 additions and 3 deletions

View File

@ -109,9 +109,9 @@ export default class StatusList extends ImmutablePureComponent {
const article = (() => { const article = (() => {
switch (e.key) { switch (e.key) {
case 'PageDown': case 'PageDown':
return e.nativeEvent.path[0].nodeName === 'ARTICLE' && e.nativeEvent.path[0].nextElementSibling; return e.target.nodeName === 'ARTICLE' && e.target.nextElementSibling;
case 'PageUp': case 'PageUp':
return e.nativeEvent.path[0].nodeName === 'ARTICLE' && e.nativeEvent.path[0].previousElementSibling; return e.target.nodeName === 'ARTICLE' && e.target.previousElementSibling;
case 'End': case 'End':
return this.node.querySelector('[role="feed"] > article:last-of-type'); return this.node.querySelector('[role="feed"] > article:last-of-type');
case 'Home': case 'Home':

View File

@ -53,7 +53,7 @@ export default class ModalRoot extends React.PureComponent {
} }
componentDidUpdate (prevProps) { componentDidUpdate (prevProps) {
if (!this.type && !!prevProps.type) { if (!this.props.type && !!prevProps.type) {
this.getSiblings().forEach(sibling => sibling.removeAttribute('inert')); this.getSiblings().forEach(sibling => sibling.removeAttribute('inert'));
this.activeElement.focus(); this.activeElement.focus();
this.activeElement = null; this.activeElement = null;