diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm index 5b9db6fb76..72afd7af85 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm @@ -146,7 +146,9 @@ BOOL defaultOrientation(CGSize const & size) BOOL const isStart = ([MWMRouter startPoint] == nil); auto const type = isStart ? kStatRoutingPointTypeStart : kStatRoutingPointTypeFinish; [Statistics logEvent:kStatRoutingTooltipClicked withParameters:@{kStatRoutingPointType : type}]; - [MWMSearchManager manager].state = MWMSearchManagerStateDefault; + auto searchManager = [MWMSearchManager manager]; + searchManager.isRoutingTooltipSearch = YES; + searchManager.state = MWMSearchManagerStateDefault; } - (IBAction)addLocationRoutePoint diff --git a/iphone/Maps/UI/Search/MWMSearchManager.h b/iphone/Maps/UI/Search/MWMSearchManager.h index 5a71a839fa..b3fad7716b 100644 --- a/iphone/Maps/UI/Search/MWMSearchManager.h +++ b/iphone/Maps/UI/Search/MWMSearchManager.h @@ -12,6 +12,7 @@ @property(nullable, weak, nonatomic) IBOutlet MWMSearchTextField * searchTextField; @property(nonatomic) MWMSearchManagerState state; +@property(nonatomic) BOOL isRoutingTooltipSearch; @property(nonnull, nonatomic) IBOutletCollection(UIView) NSArray * topViews; diff --git a/iphone/Maps/UI/Search/MWMSearchManager.mm b/iphone/Maps/UI/Search/MWMSearchManager.mm index 2c1318279d..7b0611a764 100644 --- a/iphone/Maps/UI/Search/MWMSearchManager.mm +++ b/iphone/Maps/UI/Search/MWMSearchManager.mm @@ -190,8 +190,7 @@ using Observers = NSHashTable; - (void)dismissKeyboard { [self.searchTextField resignFirstResponder]; } - (void)processSearchWithResult:(search::Result const &)result { - auto const navigationState = [MWMNavigationDashboardManager manager].state; - if (navigationState == MWMNavigationDashboardStatePrepare) + if (self.isRoutingTooltipSearch) { BOOL const hasFinish = ([MWMRouter finishPoint] != nil); auto point = [[MWMRoutePoint alloc] @@ -209,7 +208,7 @@ using Observers = NSHashTable; { [MWMSearch showResult:result]; } - if (!IPAD || navigationState != MWMNavigationDashboardStateHidden) + if (!IPAD || [MWMNavigationDashboardManager manager].state != MWMNavigationDashboardStateHidden) self.state = MWMSearchManagerStateHidden; } @@ -247,6 +246,7 @@ using Observers = NSHashTable; - (void)changeToHiddenState { + self.isRoutingTooltipSearch = NO; [self endSearch]; [self.tabbedController resetSelectedTab];