From bc6e459dfead4c88b32466ae95cde0d81881c63e Mon Sep 17 00:00:00 2001 From: Sharyn Date: Mon, 9 Jul 2018 17:01:51 +0200 Subject: [PATCH] Updating search results on selecting topic/project --- components/browseArchives/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/browseArchives/index.js b/components/browseArchives/index.js index 0376e7b..1572f65 100644 --- a/components/browseArchives/index.js +++ b/components/browseArchives/index.js @@ -43,7 +43,7 @@ class BrowseArchives extends React.Component { this.setState({ isSearchActive: false }); } - // Throttle search result frequency with debounce + // Throttle search result frequency with debounce while typing getSearchResults(term); } @@ -65,10 +65,14 @@ class BrowseArchives extends React.Component { } setSearchTerm = (event) => { + const { term } = this.state; + this.setState({ term: event.target.innerText, isSearchActive: true, }); + + this.getSearchResults(term); } clearSearchInput = () => {