Skip to content

TagSpaces is an offline, open source, document manager with tagging support

optimizing search in mobile mode

Ilian Sapundshievc1771696750e
diff --git a/app/components/FolderContainer.js b/app/components/FolderContainer.js
index 95b34e45d..84a1623b6 100644
--- a/app/components/FolderContainer.js
+++ b/app/components/FolderContainer.js
@@ -446,7 +446,7 @@ class FolderContainer extends React.Component<Props, State> {
</Button>
)}
<CounterBadge
- showZero={false}
+ showZero={true}
title={searchResultCounterText}
badgeContent={searchResultCount}
color="secondary"
diff --git a/app/components/Search.js b/app/components/Search.js
index 7b4c045d2..eb071e450 100644
--- a/app/components/Search.js
+++ b/app/components/Search.js
@@ -189,6 +189,13 @@ class Search extends React.Component<Props, State> {
});
};
+ clickSearchButton = () => {
+ this.executeSearch();
+ if (this.props.hideDrawer) {
+ this.props.hideDrawer();
+ }
+ }
+
openPlace = () => {
const { tagPlaceLat, tagPlaceLong } = this.state;
if (tagPlaceLat && tagPlaceLong) {
@@ -198,6 +205,9 @@ class Search extends React.Component<Props, State> {
startSearch = event => {
if (event.key === 'Enter' || event.keyCode === 13) {
+ if (this.props.hideDrawer) {
+ this.props.hideDrawer();
+ }
this.executeSearch();
}
};
@@ -252,9 +262,6 @@ class Search extends React.Component<Props, State> {
};
console.log('Search object: ' + JSON.stringify(searchQuery));
this.props.searchLocationIndex(searchQuery);
- if (this.props.hideDrawer) {
- this.props.hideDrawer();
- }
};
render() {
@@ -572,7 +579,7 @@ class Search extends React.Component<Props, State> {
variant="outlined"
size="small"
color="primary"
- onClick={this.executeSearch}
+ onClick={this.clickSearchButton}
>
{indexing ? 'Search disabled while indexing' : i18n.t('searchTitle')}
</Button>&nbsp;