move focus to poll panel when open

This commit is contained in:
KDSBrowne 2019-05-06 20:18:23 +00:00
parent ca4540b141
commit adea7b90e6

View File

@ -6,6 +6,7 @@ import { withModalMounter } from '/imports/ui/components/modal/service';
import _ from 'lodash';
import { Session } from 'meteor/session';
import Button from '/imports/ui/components/button/component';
import { findDOMNode } from 'react-dom';
import LiveResult from './live-result/component';
import { styles } from './styles.scss';
@ -107,6 +108,10 @@ class Poll extends Component {
this.handleBackClick = this.handleBackClick.bind(this);
}
componentDidMount() {
findDOMNode(this.hideBtn).focus();
}
componentDidUpdate() {
const { currentUser } = this.props;
@ -321,6 +326,7 @@ class Poll extends Component {
<div>
<header className={styles.header}>
<Button
ref={(node) => { this.hideBtn = node; }}
tabIndex={0}
label={intl.formatMessage(intlMessages.pollPaneTitle)}
icon="left_arrow"