From b88a7cb33b56e318f11670e9e2d563aef94db039 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Mon, 8 Mar 2021 22:45:39 -0500 Subject: [PATCH] Search: dont adjust height if not rendered --- js/src/forum/components/Search.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/src/forum/components/Search.js b/js/src/forum/components/Search.js index cc1083c03..5f1b82ce2 100644 --- a/js/src/forum/components/Search.js +++ b/js/src/forum/components/Search.js @@ -114,6 +114,9 @@ export default class Search extends Component { // Highlight the item that is currently selected. this.setIndex(this.getCurrentNumericIndex()); + // If there are no sources, the search view is not shown. + if (!this.sources.length) return; + // Since extensions might add elements above the search box on mobile, // we need to calculate and set the max height dynamically. const resultsElementMargin = 14;