Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

remove close button from searchInput

ammarahm-ed896c3b3f28bc
diff --git a/apps/mobile/src/components/Container/index.js b/apps/mobile/src/components/Container/index.js
index f5560b02c..b440714c2 100644
--- a/apps/mobile/src/components/Container/index.js
+++ b/apps/mobile/src/components/Container/index.js
@@ -14,7 +14,7 @@ import {br, opacity, pv, SIZE, WEIGHT} from '../../common/common';
import {useTracked} from '../../provider';
import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager';
import {eScrollEvent, eOpenLoginDialog} from '../../services/events';
-import {getElevation, h, w} from '../../utils/utils';
+import {getElevation, h, w, ToastEvent} from '../../utils/utils';
import {Header} from '../header';
import {Search} from '../SearchInput';
import SelectionHeader from '../SelectionHeader';
@@ -88,6 +88,7 @@ export const Container = ({
};
const onSubmitEditing = async () => {
if (!text || text.length < 1) {
+ ToastEvent.show('Please enter a search keyword');
clearSearch();
} else {
//setKeyword(text);
diff --git a/apps/mobile/src/components/SearchInput/index.js b/apps/mobile/src/components/SearchInput/index.js
index b1a49b3f8..b1ed132ae 100644
--- a/apps/mobile/src/components/SearchInput/index.js
+++ b/apps/mobile/src/components/SearchInput/index.js
@@ -94,13 +94,9 @@ export const Search = props => {
<Icon
style={{paddingRight: DDS.isTab ? 12 : 12}}
onPress={() => {
- props.clear();
- searchResults.length > 0 ? props.clearSearch() : null;
- inputRef.current.setNativeProps({
- text: '',
- });
+ props.onSubmitEditing();
}}
- name={searchResults.length > 0 ? 'close' : 'magnify'}
+ name="magnify"
color={
focus
? props.headerColor