Added focus to the sidebar textbox when it is opened

Этот коммит содержится в:
hmhealey
2016-02-04 15:07:06 -05:00
родитель c11446657f
Коммит c4344f8c02

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

@@ -75,6 +75,8 @@ class CreateComment extends React.Component {
componentDidMount() {
PreferenceStore.addChangeListener(this.onPreferenceChange);
window.addEventListener('resize', this.handleResize);
this.refs.textbox.focus();
}
componentWillUnmount() {
PreferenceStore.removeChangeListener(this.onPreferenceChange);
@@ -95,6 +97,10 @@ class CreateComment extends React.Component {
$('.post-right__scroll').perfectScrollbar('update');
}
}
if (prevProps.rootId !== this.props.rootId) {
this.refs.textbox.focus();
}
}
handleSubmit(e) {
e.preventDefault();