Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion BetterStats/BetterStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using UnityEngine;
using UnityEngine.UI;
using System.Globalization;
using UnityEngine.EventSystems;

namespace BetterStats
{
Expand Down Expand Up @@ -440,10 +441,24 @@ public static void UIStatisticsWindow__OnOpen_Postfix(UIStatisticsWindow __insta

_inputField.onValueChanged.AddListener((string value) =>
{
filterStr = value;
if (_inputField.wasCanceled)
{
// When escape key is pressed keep the current value. The default behavior was to reset/restore value to the previous submitted text
_inputField.text = filterStr;
}
else
{
filterStr = value;
}
__instance.ComputeDisplayEntries();
});

_inputField.onEndEdit.AddListener((string value) =>
{
// Reset focus to allow pressing escape key to close production panel after entering value into filter inputField
EventSystem.current.SetSelectedGameObject(null);
});

chxGO.transform.SetParent(__instance.productSortBox.transform.parent, false);
txtGO.transform.SetParent(chxGO.transform, false);
filterGO.transform.SetParent(__instance.productSortBox.transform.parent, false);
Expand Down