Skip to content

Commit

Permalink
Fix a bug where the autocomplete options weren't being reset when an …
Browse files Browse the repository at this point in the history
…item was selected
  • Loading branch information
Risha Mars committed Jan 20, 2018
1 parent fae7af4 commit 5cdf9b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions web/app/css/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,9 @@

& .ant-input {
border: 1px solid #7395C8;

&.ant-select-search__field {
color: white;
}
}
}
8 changes: 6 additions & 2 deletions web/app/js/components/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default class Sidebar extends React.Component {

this.state = {
autocompleteValue: '',
deployments: []
deployments: [],
filteredDeployments: []
};
}

Expand All @@ -42,7 +43,10 @@ export default class Sidebar extends React.Component {
onAutocompleteSelect(deployment) {
let pathToDeploymentPage = `/deployment?deploy=${deployment}`;
this.props.history.push(pathToDeploymentPage);
this.setState({ autocompleteValue: '' });
this.setState({
autocompleteValue: '',
filteredDeployments: this.state.deployments
});
}

filterDeployments(search) {
Expand Down

0 comments on commit 5cdf9b7

Please sign in to comment.