From dbfcc51bb77f67ec0b86b0301699f2577b0341e0 Mon Sep 17 00:00:00 2001 From: Andy Rickert Date: Wed, 5 Aug 2020 12:37:33 -0400 Subject: highlighting case sensitive' --- src/client/views/collections/CollectionSchemaCells.tsx | 5 +++-- src/client/views/search/SearchBox.tsx | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx index 98b7b7739..f627faa63 100644 --- a/src/client/views/collections/CollectionSchemaCells.tsx +++ b/src/client/views/collections/CollectionSchemaCells.tsx @@ -243,7 +243,7 @@ export class CollectionSchemaCell extends React.Component { // // ); const positions = []; - if (StrCast(this.props.Document._searchString) !== "") { + if (StrCast(this.props.Document._searchString).toLowerCase() !== "") { const cfield = ComputedField.WithoutComputed(() => FieldValue(props.Document[props.fieldKey])); let term = ""; if (cfield !== undefined) { @@ -257,7 +257,8 @@ export class CollectionSchemaCell extends React.Component { term = String(NumCast(cfield)); } } - const search = StrCast(this.props.Document._searchString); + term = term.toLowerCase(); + const search = StrCast(this.props.Document._searchString).toLowerCase(); let start = term.indexOf(search); let tally = 0; if (start !== -1) { diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index 097e6c4d9..113e5f6ca 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -299,7 +299,7 @@ export class SearchBox extends ViewBoxBaseComponent { Object.keys(proto).forEach(key => { - if (StrCast(d[key]).includes(query) && !hlights.includes(key)) { + if (StrCast(d[key]).toLowerCase().includes(query) && !hlights.includes(key)) { hlights.push(key); } }); @@ -763,9 +763,6 @@ export class SearchBox extends ViewBoxBaseComponent
- {/* StrCast(this.layoutDoc._searchString) ? this.startDragCollection() : undefined)} ref={this.collectionRef} title="Drag Results as Collection"> - - */}
{Doc.CurrentUserEmail}
StrCast(this.layoutDoc._searchString) ? this.startDragCollection() : undefined)} icon={"search"} size="lg" -- cgit v1.2.3-70-g09d2