fix search results not clear on navigate.

This commit is contained in:
ammarahm-ed
2020-03-02 15:24:14 +05:00
parent 2dd7d937be
commit 231cde44e1

View File

@@ -30,6 +30,7 @@ import {eSendEvent} from '../../services/eventManager';
import {eOpenModalMenu, eSendSideMenuOverlayRef} from '../../services/events';
import NavigationService from '../../services/NavigationService';
import {timeSince, getElevation, hexToRGBA} from '../../utils/utils';
import {inputRef} from '../SearchInput';
export const Menu = ({
close = () => {},
@@ -201,7 +202,12 @@ export const Menu = ({
activeOpacity={opacity / 2}
onPress={() => {
item.close === false ? null : close();
if (item.close) {
inputRef.current?.setNativeProps({
text: '',
});
dispatch({type: ACTIONS.SEARCH_RESULTS, results: []});
}
item.func();
}}
style={{