InputText: Fixed a bug where ESCAPE would be first captured by the Keyboard Navigation code. (#2321, #787)

This commit is contained in:
omar
2019-01-30 15:16:09 +01:00
parent 158995f271
commit fb4f1ff7f6
4 changed files with 10 additions and 3 deletions

View File

@ -2644,6 +2644,7 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
}
g.ActiveId = id;
g.ActiveIdAllowNavDirFlags = 0;
g.ActiveIdBlockNavInputFlags = 0;
g.ActiveIdAllowOverlap = false;
g.ActiveIdWindow = window;
if (id)
@ -7630,7 +7631,8 @@ static void ImGui::NavUpdate()
{
if (g.ActiveId != 0)
{
ClearActiveID();
if (!(g.ActiveIdBlockNavInputFlags & (1 << ImGuiNavInput_Cancel)))
ClearActiveID();
}
else if (g.NavWindow && (g.NavWindow->Flags & ImGuiWindowFlags_ChildWindow) && !(g.NavWindow->Flags & ImGuiWindowFlags_Popup) && g.NavWindow->ParentWindow)
{