Fix UI crash when keyboard navigating out of popup list.

This commit is contained in:
Henrik Rydgård 2017-11-30 01:21:03 +01:00
parent 0207739d76
commit 0d60c3f386
2 changed files with 5 additions and 3 deletions

View file

@ -264,7 +264,7 @@ private:
const char *category_;
ScreenManager *screenManager_;
std::string valueText_;
bool restoreFocus_;
bool restoreFocus_ = false;
std::set<int> hidden_;
};

View file

@ -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;
}