diff options
Diffstat (limited to 'scraper/client/common/autocomplete.component.js')
| -rw-r--r-- | scraper/client/common/autocomplete.component.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scraper/client/common/autocomplete.component.js b/scraper/client/common/autocomplete.component.js index e2908cd1..a619e2c8 100644 --- a/scraper/client/common/autocomplete.component.js +++ b/scraper/client/common/autocomplete.component.js @@ -49,6 +49,10 @@ class Autocomplete extends Component { componentDidMount() { // build index based on what's in the hierarchy + if (!this.props.institutions.loading) this.buildIndex() + } + + buildIndex() { const { entities, lookup } = this.props.institutions let index = [] this.index = index @@ -69,6 +73,9 @@ class Autocomplete extends Component { } componentDidUpdate(oldProps) { + if (oldProps.institutions.loading && !this.props.institutions.loading) { + this.buildIndex() + } if (this.props.vetting !== oldProps.vetting) { this.handleChange({ target: { value: this.props.vetting } }) } else if (this.props.value !== oldProps.value) { |
