'Add Members' Modal Focuses Searchbar Fix (#5608)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
83291e4c8f
Коммит
fa04d2bf3a
@@ -19,6 +19,7 @@ export default class SearchableUserList extends React.Component {
|
|||||||
this.nextPage = this.nextPage.bind(this);
|
this.nextPage = this.nextPage.bind(this);
|
||||||
this.previousPage = this.previousPage.bind(this);
|
this.previousPage = this.previousPage.bind(this);
|
||||||
this.doSearch = this.doSearch.bind(this);
|
this.doSearch = this.doSearch.bind(this);
|
||||||
|
this.focusSearchBar = this.focusSearchBar.bind(this);
|
||||||
|
|
||||||
this.nextTimeoutId = 0;
|
this.nextTimeoutId = 0;
|
||||||
|
|
||||||
@@ -30,15 +31,14 @@ export default class SearchableUserList extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (this.props.focusOnMount) {
|
this.focusSearchBar();
|
||||||
this.refs.filter.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps, prevState) {
|
componentDidUpdate(prevProps, prevState) {
|
||||||
if (this.state.page !== prevState.page) {
|
if (this.state.page !== prevState.page) {
|
||||||
$(ReactDOM.findDOMNode(this.refs.userList)).scrollTop(0);
|
$(ReactDOM.findDOMNode(this.refs.userList)).scrollTop(0);
|
||||||
}
|
}
|
||||||
|
this.focusSearchBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -57,6 +57,12 @@ export default class SearchableUserList extends React.Component {
|
|||||||
this.setState({page: this.state.page - 1});
|
this.setState({page: this.state.page - 1});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
focusSearchBar() {
|
||||||
|
if (this.props.focusOnMount) {
|
||||||
|
this.refs.filter.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
doSearch() {
|
doSearch() {
|
||||||
const term = this.refs.filter.value;
|
const term = this.refs.filter.value;
|
||||||
this.props.search(term);
|
this.props.search(term);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user