From a35a047cc2ced41c6702da18588a736d97fcd9cb Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 23 Apr 2019 07:51:02 -0700 Subject: [PATCH] Fixes: Loading indicator on search screen load Fixes: Unscrollable dropdowns with large datasets --- app/scenes/Search/Search.js | 5 ++++- app/scenes/Search/components/FilterOptions.js | 13 +++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/scenes/Search/Search.js b/app/scenes/Search/Search.js index 9814a519..6c7b47dd 100644 --- a/app/scenes/Search/Search.js +++ b/app/scenes/Search/Search.js @@ -53,7 +53,10 @@ class Search extends React.Component { componentDidMount() { this.handleTermChange(); - this.handleQueryChange(); + + if (this.props.location.search) { + this.handleQueryChange(); + } } componentDidUpdate(prevProps) { diff --git a/app/scenes/Search/components/FilterOptions.js b/app/scenes/Search/components/FilterOptions.js index 072dfa85..1a479a25 100644 --- a/app/scenes/Search/components/FilterOptions.js +++ b/app/scenes/Search/components/FilterOptions.js @@ -48,7 +48,6 @@ const FilterOptions = ({ const Content = styled('div')` padding: 0 8px; width: 250px; - max-height: 50vh; p { margin-bottom: 0; @@ -78,14 +77,20 @@ const SearchFilter = props => { leftAlign > {({ closePortal }) => ( - - {props.children} - + + {props.children} + )} ); }; +const MaxHeightScrollable = styled(Scrollable)` + max-height: 50vh; + margin: -8px 0; + padding: 8px 0; +`; + const DropdownButton = styled(SearchFilter)` margin-right: 8px; `;