From c04c831133072aed911c131eba799561ec911664 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 19 Aug 2020 13:34:50 -0400 Subject: from last --- src/client/views/search/SearchBox.tsx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index 7a4e75f21..eafe58cbe 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -877,15 +877,15 @@ export class SearchBox extends ViewBoxBaseComponent([]); this.resultsScrolled(); } + returnHeight = () => 31 + 31 * 6; + returnLength = () => { + const cols = Cast(this.props.Document._schemaHeaders, listSpec(SchemaHeaderField), []).length; + return cols * 205 + 51; + } render() { this.props.Document._chromeStatus === "disabled"; this.props.Document._searchDoc = true; - const cols = Cast(this.props.Document._schemaHeaders, listSpec(SchemaHeaderField), []).length; - let length = 0; - length = cols * 205 + 51; - let height = 0; const rows = this.children; - height = 31 + 31 * 6; return (
{Doc.CurrentUserEmail}
@@ -923,9 +923,7 @@ export class SearchBox extends ViewBoxBaseComponent(this.docsforfilter); const newdocs = DocListCast(d.data); - newdocs.forEach((newdoc) => { - newarray.push(newdoc); - }); + newdocs.forEach(newdoc => newarray.push(newdoc)); } }); docs = newarray; @@ -945,9 +943,7 @@ export class SearchBox extends ViewBoxBaseComponent(); d._docFilters = new List(); const newdocs = DocListCast(d.data); - newdocs.forEach((newdoc) => { - newarray.push(newdoc); - }); + newdocs.forEach(newdoc => newarray.push(newdoc)); } }); docs = newarray; @@ -1058,8 +1054,8 @@ export class SearchBox extends ViewBoxBaseComponent height : returnZero} - PanelWidth={this.open ? () => length : returnZero} + PanelHeight={this.open ? this.returnHeight : returnZero} + PanelWidth={this.open ? this.returnLength : returnZero} overflow={length > window.innerWidth || rows > 6 ? true : false} focus={this.selectElement} ScreenToLocalTransform={Transform.Identity} -- cgit v1.2.3-70-g09d2