From a88f9b66119bf353d8499ab753192ee0606d33d8 Mon Sep 17 00:00:00 2001 From: ReAdmin <170283204+rewalo@users.noreply.github.com> Date: Wed, 7 Oct 2026 02:24:27 -0700 Subject: [PATCH] Give the wiki search box a caret so clearing it does not corrupt input --- MiraAPI/Patches/RoleGuidePatches.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/MiraAPI/Patches/RoleGuidePatches.cs b/MiraAPI/Patches/RoleGuidePatches.cs index 0ae0507..3398d5f 100644 --- a/MiraAPI/Patches/RoleGuidePatches.cs +++ b/MiraAPI/Patches/RoleGuidePatches.cs @@ -272,6 +272,9 @@ public static class RoleGuidePatches button.OnUp = true; _searchBoxTmp = searchBox.AddComponent(); _searchBoxTmp.outputText = tmpText; + var pipe = new GameObject("Pipe") { layer = searchBox.layer }; + pipe.transform.SetParent(_searchBoxTmp.transform, false); + _searchBoxTmp.Pipe = pipe.AddComponent(); button.OnClick.AddListener((UnityAction)(() => { _searchBoxTmp.GiveFocus(); })); button.OnMouseOver = new UnityEvent(); button.OnMouseOut = new UnityEvent(); @@ -469,8 +472,11 @@ public static class RoleGuidePatches private static void UpdateSpinner() { - _loadingSpinner?.gameObject.SetActive( - !_panelsReady && MatchInfoGuide.Instance.activeTabIndex is RolesTabIndex or ModifiersTabIndex); + if (_loadingSpinner != null) + { + _loadingSpinner.gameObject.SetActive( + !_panelsReady && MatchInfoGuide.Instance.activeTabIndex is RolesTabIndex or ModifiersTabIndex); + } } private static float GetGridScrollBounds(int count) @@ -515,8 +521,7 @@ public static class RoleGuidePatches _searchIconHover.sprite = MiraAssets.SearchIconHoverSprite; if (_searchBoxTmp) { - _searchBoxTmp.outputText.text = string.Empty; - _searchBoxTmp.text = string.Empty; + _searchBoxTmp.Clear(); } RefreshActiveTab(true);