From 231cde44e116fe8e01b01822fcedf5cd61297fbf Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Mon, 2 Mar 2020 15:24:14 +0500 Subject: [PATCH] fix search results not clear on navigate. --- apps/mobile/src/components/Menu/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.js index c0d57e5ba..3c742f8fd 100644 --- a/apps/mobile/src/components/Menu/index.js +++ b/apps/mobile/src/components/Menu/index.js @@ -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={{