Adding focus for channel modals

Этот коммит содержится в:
Asaad Mahmood
2015-11-04 20:07:58 +05:00
родитель 2840c317e5
Коммит 71035bfdc7
3 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@@ -15,6 +15,12 @@ export default class EditChannelPurposeModal extends React.Component {
this.state = {serverError: ''};
}
componentDidUpdate() {
if (this.props.show) {
$(ReactDOM.findDOMNode(this.refs.purpose)).focus();
}
}
handleHide() {
this.setState({serverError: ''});
@@ -77,6 +83,7 @@ export default class EditChannelPurposeModal extends React.Component {
return (
<Modal
className='modal-edit-channel-purpose'
ref='modal'
show={this.props.show}
onHide={this.handleHide}
>