Skip to content

Commit

Permalink
[BUG-FIX] Always update items in autocomplete (#558)
Browse files Browse the repository at this point in the history
* Always update data

* Fix linting

* Bump package version
  • Loading branch information
kaytcat authored Jun 26, 2019
1 parent fd89d0d commit e686aec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nukleus",
"version": "15.0.3",
"version": "15.0.4",
"description": "Shared components repo for kununu projects",
"main": "dist/components/index.js",
"repository": {
Expand Down
5 changes: 1 addition & 4 deletions src/components/Autocomplete/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,12 @@ export default class Autocomplete extends React.Component {

componentWillReceiveProps (nextProps) {
const {
data,
query,
name,
} = this.props;
const queryObject = queryParamsToObject(query);

if (JSON.stringify(nextProps.data.items) !== JSON.stringify(data.items)) {
this.setState({suggestions: nextProps.data.items});
}
this.setState({suggestions: nextProps.data.items});

if (nextProps.error) this.showError();
if (!this.needsUpdate(nextProps)) return;
Expand Down

0 comments on commit e686aec

Please sign in to comment.