From c6fabd1ae9d85dc0e9b2cf86d3bbd3c0a8a4c25b Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 19 Aug 2020 13:28:30 -0400 Subject: fixed searchBox to be more efficient by avoiding react renders --- src/client/views/search/SearchBox.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index 10a45b34a..7a4e75f21 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -11,7 +11,7 @@ import { List } from '../../../fields/List'; import { createSchema, listSpec, makeInterface } from '../../../fields/Schema'; import { SchemaHeaderField } from '../../../fields/SchemaHeaderField'; import { Cast, NumCast, StrCast } from '../../../fields/Types'; -import { returnFalse, Utils } from '../../../Utils'; +import { returnFalse, Utils, returnZero } from '../../../Utils'; import { Docs } from '../../documents/Documents'; import { DocumentType } from "../../documents/DocumentTypes"; import { CurrentUserUtils } from '../../util/CurrentUserUtils'; @@ -967,7 +967,7 @@ export class SearchBox extends ViewBoxBaseComponent
@@ -1053,13 +1053,13 @@ export class SearchBox extends ViewBoxBaseComponent {this._searchbarOpen === true ?
- {this.noresults === "" ?
+ {this.noresults === "" ?
height : () => 0} - PanelWidth={this.open === true ? () => length : () => 0} + PanelHeight={this.open ? () => height : returnZero} + PanelWidth={this.open ? () => length : returnZero} overflow={length > window.innerWidth || rows > 6 ? true : false} focus={this.selectElement} ScreenToLocalTransform={Transform.Identity} -- cgit v1.2.3-70-g09d2