Permalink
Browse files

Fix UI crash when keyboard navigating out of popup list.

  • Loading branch information...
hrydgard committed Nov 30, 2017
1 parent 0207739 commit 0d60c3f386810b26c1744217bbb3357d5509a13f
Showing with 5 additions and 3 deletions.
  1. +1 −1 ext/native/ui/ui_screen.h
  2. +4 −2 ext/native/ui/viewgroup.cpp
@@ -264,7 +264,7 @@ class PopupMultiChoice : public UI::Choice {
const char *category_;
ScreenManager *screenManager_;
std::string valueText_;
bool restoreFocus_;
bool restoreFocus_ = false;
std::set<int> hidden_;
};
@@ -1314,8 +1314,10 @@ EventReturn ListView::OnItemCallback(int num, EventParams &e) {
View *focused = GetFocusedView();
OnChoice.Trigger(ev);
CreateAllItems();
if (focused)
SetFocusedView(e.v);
// TODO: At this point, focused may no longer exist, depending on what OnChoice.Trigger does.
// Disable the refocus feature for now.
// if (focused)
// SetFocusedView(e.v);
return EVENT_DONE;
}

0 comments on commit 0d60c3f

Please sign in to comment.